Limit number of trading signals while exploring


I want to control the number of trades which can be executed during a live trading session. I normally use scan option and run a watchlist which has multiple stocks.

I want the trade limit in exploration / scanning (NOT BACKTESTING).

I use exploration in intraday trading over portfolio of stocks to fire orders in my broker but I only want 2 signals in my exploration results so that extra orders will not be punched in my broker platform. Please help me .

You could use StaticVarAdd to count signals across symbols, but actually, it is easier just to run backtest. It performs ranking and sorting and would limit number of entries according to your desire automatically.

In custom backtest procedure you could easily iterate through last bar signals and open positions.

Hello Tomsaz sir I am able to store the number of buy signals since the new day in the array NUMEROFBUYSIGNALSINDAY array in the code attached below , please help me to get only the very first signal of the day in the exploration results of the day as I fire algo orders using exploration results and I only want to punch the order for the very first trade of the day and its possible only after getting only the first exploration result of the day and ignore the rest of the signals ,,,,, as per your advice sir I am counting and storing the number of signals with the help of addtocomposite function and storing the number of signals in the array called numberofsignalsinday , code is attached below, now help me to get only the first trading signal in the exploration results and ignore the rest.`// long

pdc = TimeFrameGetPrice("C",inDaily,-1); //previous day close.

Buy = High > Ref(High,-1) AND C > pdc * 1.02;
long = Flip(newday,TimeNum()==130000);
EntryPrice = IIf(long, ValueWhen(Buy,C), 0);

AddToComposite( Buy, "~yt", "V" );


price = Foreign("~yt","V");
printf("\nprice : " + price);

numberofsignalsinday = ValueWhen(newday,price);
printf("\nnumberofsignalsinday : " + newdayprice);

Filter = Buy AND numberofsignalsinday<2; // it is causing some problem when 2 buy signals appears at the same time.

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.