[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 147

 
papa-di:

Could you please tell me how to modify my EA to trade on Market Execution so that it opens with zero Take Profit and Stop Loss and then sets Stop Loss and Take Profit?

Please write a typical code. Thank you in advance.

Here and here.

If it does not help, then here.

If it does not help, please order it here.

 
Can you please tell me how to make my EA make only one trade on one bar and not several. Mql4 is just starting to learn, I don't understand what criteria to set so that it does not make several trades on one bar.
 
remember the time of the bar at which the order was opened
 

Try the easiest (although not the best) way to get started:

Add OrdersTotal()==0 to your opening conditions.

 
DhP:

Try the easiest (although not the best) way to get started:

Add OrdersTotal()==0 to your opening conditions.

I have this, the problem is not the simultaneous opening of several orders, but the opening of several orders on one bar, i.e. one order is closed and immediately, on the same bar, the second order is opened, if the condition allows it, and it does, since the first order was opened.
 
Would it then be better to put a ban on opening an order until the condition goes away? What timeframe are you working on?
 
Bit99:
I have this, the problem is not opening multiple orders at the same time, but opening multiple orders on the same bar, i.e. one order is closed and immediately, on the same bar, the second order is opened, if the condition allows it, which it does, because the first order was opened.
Another simple way to avoid these troubles:
    datetime  prevtime;

int start(){


     datetime time=iTime(NULL,0,0);
     if(time==prevtime) return(0); 
     prevtime = time;   

   

  return(0);
}
 

Is there any way to get the iMa indicator to return 5 decimal places instead of 4.

The MT shows a five-digit value on the chart when hovering over the line...
 
fx-fantom:

Is there any way to get the iMa indicator to return 5 decimal places rather than 4.

The MT shows a five-digit value on the chart when hovering over the line...

What makes you think it returns 4 digits?
 
Don't worry, he gives back as much as he needs, you just have to want to see it.
Reason: