PureBytes Links
Trading Reference Links
|
> If MarketPosition <> 1 Then
> ExitLong ("EBP") Next Bar at Close - RiskPnts Points Stop;
>
> I am a little confused about the 'If' conditional. How can a stop
> order be placed if MarketPosition <> 1 (i.e., you are not in the
> market yet?).
Buy/sell/exit orders take effect on the NEXT bar. So this has the
result of setting long exit stops on all bars when you aren't long
(which is obviously useless) AND setting it on the FIRST bar of a
long position.
E.g. if you enter an entry stop order on bar N, and that entry price
is hit on bar N, the above exitlong will be in effect on the first
bar of the position. It will NOT be in effect on any subsequent bars
of the position, because MarketPosition will then be 1.
> I was sort of thinking that this conditional should read
> MarketPosition = 1.
MarketPosition won't be 1 until the first bar of the new long
position. So testing for MarketPosition = 1 means you will set the
exit stop on the second and following bars of the position. You
probably want to do both.
Gary
|