I've now implemented a BUYSTOP_BYBID order into my strategy which is brilliant, works perfectly for new long orders. However, as I use a stop and reverse strategy I'd like to know the equivalent for the stop loss order for the Short side? The SL and new Long order are created when a crossover between a slow and fast MA occurs. When the order is short it currently sets a SL at
askBar.getHigh() + dist*pv
and the new long order uses BUYSTOP_BYBID and is set at
bidBar.getHigh() + dist*pv
. Is there an equivalent for the SL so that it triggers a close order when the bid price =
bidBar.getHigh() + dist*pv
? Otherwise it is exiting the short order at a different level to the new long order.