MINTA:
It's a bad idea to use Order comments . . . they can be modified or replaced by your Broker.
Hello,
I need EA to check opened market orders (BUY and SELL) and IF NEW bar - Open[0] is NOT equal to some of other opened orders BarOpenPrice - which is printed to OrderComment of each order to open new order. Of course if there is no open order at terminal this is not the case.
Some of code need corections. Can somebody help?
MINTA:
IF NEW bar - Open[0] is NOT equal to some of other opened orders BarOpenPrice - which is printed to OrderComment of each order to open new order.
IF NEW bar - Open[0] is NOT equal to some of other opened orders BarOpenPrice - which is printed to OrderComment of each order to open new order.
- brokers can change comments, including complete replacement. Ref
- doubles rarely compare equal/notEqual See Can price != price ? - MQL4 forum and Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
int ordticket[][2]; : ordticket[orders][0] = OrderOpenTime();
Will not work as you never resize the array BEFORE using it.- Always test return codes. If your order select fails, so does the rest of the loop.
for(int iPos = OrdersTotal()-1; iPos >= 0 ; iPos--) if( OrderSelect(iPos, SELECT_BY_POS) ) if( // Only my orders w/ OrderMagicNumber() == magic.number ) if( // my magic number, OrderSymbol() == chart.symbol ){ // and my pair.
iOpen(NULL,0,integer)
Why use a function call when you can use the simplier Open[integer]?- You know when the order was opened, find the corresponding bar and get the open
: datetime OOT = OrderOpenTime(); int iOOT = iBarShift(NULL,0, OOT); double openAtopen = Open[iOOT];

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello,
I need EA to check opened market orders (BUY and SELL) and IF NEW bar - Open[0] is NOT equal to some of other opened orders BarOpenPrice - which is printed to OrderComment of each order to open new order. Of course if there is no open order at terminal this is not the case.