Prevent trade signals for certain condition in CBT

Hi Guys,

I’m using the mid-level custom backtester with a rotational strategy and I want to prevent it from processing any trade signals under certain circumstances.

if(worstrank > 134){

for(sig = bo.GetFirstSignal(bar); sig; sig = bo.GetNextSignal(bar)){

sig.Price = -1;





I have this code which prevents new buys from being bought on these bars but it still seems to process the sells. Does anyone know a better way to prevent trade signals from being processed on a given bar?


You can use scoreNoRotate as described here:

1 Like