Download MetaTrader 5
To add comments, please log in or register
Do you have a trading signal? Publish it in your blog as well!
Sherif Hasan
7223
Sherif Hasan 2015.08.01 11:29 
double ClosedPrice = 0;
double ClosePrice=Close[0];
//double GapinPips=0;
datetime lastCloseTime = 0;
int cnt = OrdersHistoryTotal();
for (int i=0; i < cnt; i++)
{
    if (!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY)) continue;
    if (OrderSymbol() == Symbol() && lastCloseTime < OrderCloseTime())
    {
        lastCloseTime = OrderCloseTime();
        ClosedPrice = OrderClosePrice();
    }
}

double GapinPips=ClosePrice-ClosedPrice;
Comment(GapinPips);

Why its not giving the difference value between last closed order and current close price?

please mention my logic error!

whroeder1
13641
whroeder1 2015.08.01 18:29  
  1. It is
  2. Close[0] == Bid
  3. price - price is not pips.
/
To add comments, please log in or register