gfxParticipant
Average
hi gents,
I am struggling with trying to pause my strategy for 30 seconds after signal is triggered.
my system runs on a 2H minute TF with update on close.
My first idea was to use a loop for next. But quite difficult to evaluate the loop size to 30 seconds. Also, quite depending on the CPU running loop.
Does it exist a way to pause 30 seconds after the last candle closed and the ProOrder was triggered ?
Thks,
gfx
You can only achieve your goal with the help of Multi Time Frame support which enables you to use a 30-second TF as default, so that you just need to wait 1 candle after a signal is returned.
You could also use a time difference by using TIMESTAMP in any timeframe below the 30 seconds TF.
gfxParticipant
Average
hi all,
Happy new year to all !
Thank you for all your answers. They are interesting option.
On concern on my side, not in my initial post is that all occurs in a while loop …
In a nutshell …
x = 1
While x < 10
try
pause …. a few seconds …
x = x +1
wend
as part of a while loop I can’t rely on any candle end trigger, of any time frame. All occurs whithin a single candle trigger
This code waits for a condition to be met on a 1-minute TF, but it wants to wait 10 seconds before entering at market. A 1-second default TF must be used to run it:
Timeframe(1 minute,UpdateOnClose)
Flag = 0
if close crosses over average[10] and not OnMarket then
Flag = 1
endif
if close crosses under average[10] and OnMarket then
sell at Market
endif
set stop ploss 20
set target pprofit 60
//---------------------------------------------------
Timeframe(default) //1 second)
IF Flag = 0 THEN
Tally = 0
ELSE
Tally = Tally + 1
IF Tally = 10 AND Not OnMarket THEN
BUY 1 contract at market
ENDIF
ENDIF
graph Flag
gfxParticipant
Average
Thks. Still it won’t work in my situation as I am still in a while loop including other conditions than time.
A good idea though. I’ll give it some thoughts and try to adapt my code.