what is the code for ‘temporarily stop trading’ for 3 or 4 hours if a stop loss was activated?
something like (i did not test it)
//1H TF
once x=1
positionsize =1
if condition then
buy positionsize*x contract at market
endif
set target point 30
set stoploss point 10
if strategyprofit<0 then
x=0
if tradeindex<4
then x=x
else
x=1
endif
endif
If you are trading the 1 hour timeframe, you can simply use TRADEINDEX keyword, that give you the barindex number where the trades were launched at market. Then you only need to make differences between the current barindex and the last tradeindex to know if there is already 4 bars elapsed.
still didnt make it
set stop ploss 50 then set my system to stop one hour in 5 min timeframe?
1 hour is 12 bars of 5 minutes.
So your boolean condition to test if 12 bars has passed since the trade launch is:
test = barindex-tradeindex >=12
if test then
//do something here
endif