[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Displaced" MA values



PureBytes Links

Trading Reference Links

Gary F wrote:

"If you want your system to use the value of Avg that is PLOTTED on bar
X-Displace1 to make buying decisions on that bar, you will need a crystal
ball.  At bar X-Displace1 you DON'T KNOW the value that will be plotted on
that bar!  You won't know it until bar X, several bars later.

"With displaced plots you can make an indicator that LOOKS like it picked
perfect buy/sell points.  But it did that with hindsight.  You can't do it
in realtime.

"Let me know if you find a broker who lets you "displace" your orders into
the past.  :-) "

-----

How strange is it that on the very day this exchange took place I was
struggling to convert the EL indicator displaced code into a system.  Twelve
years of using TS, never once looked at a displaced MA system and here are
two of us on the same day...

Of course, I failed.  No way I could code that displaced MA to give me
today's value.  But I'd like to take one more swing at why not.

-----

foolsgold suggested:

System
input: Price(close), Length(5);
Value1=(WAverage(Price,Length)[1]);
if value1 > value1[1] then buy next bar at market;

-----

I'm working with a MA displaced into the future (-3) periods.  Of course, I
can't initiate a trade three bars into the future, but I can see the value
of that MA on the current bar.  I can bring up a data window and see both
the close of the current bar and the value of the MA in the current bar.

So why is it not possible to code the entry to say, "If current bar close is
above the displaced MA(-3) [4] " or something to indicate that the trade's
to take place today using today's figure?  If TS can generate the number for
the current bar in current time, why can't the signal see it?

Foolsgold system looks at the value of a MA in the previous bar, but it's
not a displaced MA that he's trying to drag back from the future.

Gary, or anyone else, can you point out the fault in logic?  Or suggest a
way to get the MA code working?

Many thanks,

  Bill M
  Vero Beach  FL