PureBytes Links
Trading Reference Links
|
At 11:47 AM -0400 7/27/01, mkittelson wrote:
>var: LngStp(0)
>
>If MarketPosition = 1 then LngStp = Average(close,50);
>If MarketPosition = 1 and Close >= EntryPrice + (StdDev(close, 50) * 2) then
> LngStp = Average(close,40);
>
>Any suggestions? Thanks in advance.
You can use the I_AveEntryPrice and I_MarketPosition functions.
I would also pull out the Average functions so that they calculate on every bar:
Var: LngStp(0), Ave1(0), Ave2(0);
Ave1 = Average(close, 50);
Ave2 = Average(close, 40);
if I_MarketPosition = 1 then
if Close >= I_AveEntryPrice + (StdDev(close, 50) * 2)
then LngStp = Ave2
else LngStp = Ave1;
Bob Fulks
|