I would like to add a condition to my script which will be commanding Zorro to wait for lets say 2 bars after exiting a trade and then check if conditions are true again and enter another trade....which function is best suited for this?
Thank in advance, MINER.
Re: Pause Trading - how to
[Re: MINER]
#475950 01/15/1910:1001/15/1910:10
I have included trade LifeTime = 4, I would like zorro to pause after 4th bar and check conditions again in the 6th bar for example. so i would like zorro to pause trading for two bars.
Re: Pause Trading - how to
[Re: MINER]
#475951 01/15/1912:0501/15/1912:05
Im wondering if its possible to set a delay timer between trades? I'm working on automating a strategy, but there are some times when conditions are met that trades will open and close faster then you can blink. I'm wondering if we can say "For the next 10 bars, do not open any new trades", or "For the next 60 minutes do not open any new trades"
Re: Pause Trading - how to
[Re: MINER]
#475989 01/16/1916:3901/16/1916:39
// Use an entry limit and an entry delay for not entering trades at the same time // Call this function before entering a trade ///////// void setDelay(var Seconds) { static int PrevBar = 0; static var Delay = 0;
if(Bar != PrevBar) { // reset delay at any new bar Delay = 0; PrevBar = Bar; } Delay += Seconds; // increase delay within the bar OrderDelay = Delay; Entry = -0.2*PIP * sqrt(Delay); // entry limit for additional profit