How to prevent secondary orders from executing within your strategy pack/scripts
In strategy packs with Smart Rebalancing enabled, it is logical that realized profits will get allocated to secondary signals on other strategies within the pack. There is a method to prevent that by adding this small section of code to your script with the necessary logic adjustments to suit your buy/long and sell/short needs.
LongApproved = and(LongOpen,not(position_long))
ShortApproved = and(ShortOpen,not(position_short))
//Signal Push
out(signalIf(LongApproved, ShortApproved))What this will do, is only open a trade if there is not already a position open on this strategy. (long, short or open).