I suppose the stoploss exits are taken through set exit?
You can do it this way.
Define a variable named say ExCount in “Initialise variables” and assign value Number(0) to it. (This step is also important as we are going to use this variable for condition check in Set entry, so before that the variable value must be assigned.)
Then in Set exit runtime variables increment variable ExCount by 1. For this in set exit Runtime variables enter same variable name and assign formula “Get Runtime(ExCount) + Number(1)”
Now for each exit taken the count will increase.
Now in Set 1 Entry condition you should add AND condition as “Get Runtime (ExCount) <= X”.
Then you need to reset the ExCount to zero everyday morning.
For this add a Repair Continuous. In that add condition
Time(NSE) <= 0916
AND
Get Runtime (ExCount) > 0
(make sure under Strategy advanced settings “Start Condition check after exchange open” is set to 1 second).
In Runtime variables of this Repair Continuous assign value zero to the variable ExCount.
Now Repair Continuous must have a position. But we don’t want that position to be executed actually. So add same instrument as in set 1, but in quantity(or lot) field chose Fx. And in that Fx give formula “Get Runtime (xyz)”. i.e. viarable name “xyz” here; which is not defined so it can’t be computed and no trade will be taken, but Runtime variable of the Repair Continuous gets executed. (it works I have done it.)
Please note that we are restricting Repair Continuous to be executed only once a day by having condition “Get Runtime (ExCount)” > 0 and setting it to zero in Runtime vairables of same Repair Continuous. If this is not done RC will keep on executing continuously, notification log will be full of this condition check until TT stops logging the notifications.