Compare ATR from different pairs

 

Hello guys.

One part of my EA requires to compare the ATR between different pairs when the number of pending orders is grater than 2 and delete the order with the smallest ART value.

Any ideas on how to accomplish this? Below is the part when I check for the total of BUYSTOP/SELLSTOP (pending) orders:


void control() 
{

OpenBuyOrders=0;
OpenSellOrders=0;
total=0;

//Count Pending Stop Orders
for(int i=0;i<OrdersTotal(); i++ )
{
if(OrderSelect(i, SELECT_BY_POS)==true)
{
if (OrderType()==OP_BUYSTOP)
OpenBuyOrders++;
if (OrderType()==OP_SELLSTOP)
OpenSellOrders++;
}
total=OpenBuyOrders + OpenSellOrders;
}
}
 
  1. Why did you post your MT4 question in the MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum?
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. ovatsug: Below is the part when I check for the total of BUYSTOP/SELLSTOP (pending) orders:

    Irrevalent. Show us where you get the order symbol and the corresponding ATR.

    Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12