Page 1 of 1

How to make a strategy skip 1 candle before reopening a pos?

PostPosted: Thu Dec 08, 2016 3:48 am
by ilnefopas
Hi guys,

When a trade gets closed, I'd like my strategy to wait 1 "Timeframe period" before opening a new position.
To achieve that on the the 5 minutes for instance, I created a timer that waits for 5 minutes when a trade gets closed but TSII doesn't like this way of doing things. Indeed TSII detects when a strategy "loops" for more than 30 secs, sees that as an error and pauses the strategy.
Does anyone has a "good way" of doing that without making the strategy wait, meaning just "skip" 1 candle ?

Thanks,
Ben.

Re: How to make a strategy skip 1 candle before reopening a

PostPosted: Sun Dec 18, 2016 11:25 am
by Apprentice
U can use something like this
now = core.host:execute("getServerTime");
CoolDownTime= now + (CoolDownInterval / 86400.0)))

if now < CoolDownTime then
return;
end