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

Re: Philip Bell - London - to Metastock User Group



PureBytes Links

Trading Reference Links

>  I am trying to write a formula for System Tester to generate
> a Sell when a bar crosses a moving average but does not close below,
> on a
> long trade,

 MA > low and close > MA

> the Sell has to be calculated at the price the bar intersects
> the Moving Average eg: I set a stop at the Moving  Average that
> triggers if
> the stock trades below at any time during the day, even if it ends
> higher
> at the close of days trade. Is this possible, if so I would appreciate
>
> anyone who could give me pointers on writing this formula. Philip W
> Bell -
> London U.K.

   Actually what you really need to do is solve for the close in your
moving average. And then shift it forward 1 time period. Here is an
example using a 3 day MA as your signal.

So if close < (ct + ct-1 + ct-2)/3 then sell where the close on the left
side is really the last price traded and is the same as ct. So we solve
for ct.

ct > (ct-1 + ct-2)/2      note:  (ct-1 + ct-2)/2 = ref(move(close,2,s),
-1)

now shift everything forward 1 time period
ct+1 > (ct + ct-1)/2    note:  (ct + ct-1)/2  = move(close,2,s)

So the number on the right side is the value you use to check during the
day to see if it is penetrated or not.

I hope that makes since.

Harley