Pause Trading - how to

Posted By: MINER

Pause Trading - how to - 01/15/19 09:34

Hello Community..

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.
Posted By: MINER

Re: Pause Trading - how to - 01/15/19 10: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.
Posted By: MINER

Re: Pause Trading - how to - 01/15/19 12: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"
Posted By: OptimusPrime

Re: Pause Trading - how to - 01/16/19 16:39

Here are some examples from the Manual you can adapt

//Delay every 30 seconds
for(OrderDelay = 0; OrderDelay< 10*30; OrderDelay += 30)
{
//////
}


/////////

// 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
Posted By: MINER

Re: Pause Trading - how to - 01/17/19 11:04

this is very useful to me Optimus, thank you
© 2024 lite-C Forums