PureBytes Links
Trading Reference Links
|
I need help on how to create an indicator that would do the
following:
If the MarketPosition=1 then the Stop is a 50 Day Moving Average.
If the Market Postion=1 and the Close is >= the
EntryPrice+(StdDev(close,50)*2) then the Stop becomes a 40 Day Moving
Average.
I have been able to write this into a system but cannot figure how
to make it work in an indicator as I can't use the EntryPrice in an
indicator.
I have tried writing a function with no luck.
Below is the code I have written:
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.
Mike
|