One Order per Bar.......

 

Hi Guys,

How can I limit the amount of order per bar in my EA....Basically I want EA to open only 1 order per bar.....and wait for the next bar...if the conditions fullfil then open another position....at the moment it is opening more than 1 positions in one bar....

Thanks

Babar

 

Use the following at the beginning of your start code:

datetime timeprev=0;

int start()

{

//Check for New Bar

if(timeprev==Time[0])

return(0);

timeprev=Time[0];

// Calculations go here

} //Start

 

Thanks Dude for your help......

Babar