Turning a protective stop on and off conditionally

If you want to set a protective stop price level with an indicator, but you only want it effective under some conditions (like time of day), here is how it can be done:

  If Time<=3:50PM then StopPriceIndicator Else *

The above code (which uses the unpublished and unsupported NULL character *) would cause the stop order to cancel on the 3:55 bar in a 5 minute bar chart. If you want it effective only certain times you could use:

  If X<=Time<=Y then StopPriceIndicator Else *

How about stopping only in November when the price is < 116:

  If AND2(NovemberFlag,A<B(Close,116)) then StopPriceIndicator Else *

Was this article helpful?

Related Articles