Download MetaTrader 5

OrderProfit giving wrong value - page 2

To add comments, please log in or register
Saravanakumar D
360
Saravanakumar D  
WHRoeder:
  1. Not clear? What part of Returns the net profit value (without swaps or commissions) confused you? What broker do you know charges commissions in pips?
  2. Tick Value must be used as a ratio

return(DeltaValuePerLot() * pips2dbl);

where the pips2dbl get value?..

whroeder1
15735
whroeder1  
  1. Posted my code Why is there NO Complete EA within the Code-Base? - MQL4 forum It has not been adjusted for Build 600+.
  2. Now I use pips_to_change
    #define  CHANGE         double      ///< Difference of two prices.
    #define  POINT          int         ///< `CHANGE / _Point`.
    #define  PIP            double      ///< `POINT / PipsPerPOINT`.
    CHANGE   points_to_change(POINT n){          return n * _Point;                }
    POINT    change_to_points(CHANGE c){         return POINT(c / _Point + 0.5);   }
    CHANGE   pips_to_change(PIP n){     return points_to_change(pips_to_points(n));}
    PIP      change_to_pips(CHANGE c){  return points_to_pips(change_to_points(c));}
    // Digits DE30=1/JPY=3/EURUSD=5 10 pt/PIP.  forum.mql4.com/43064#515262
    // tick 0.5       tick = point = 0.001
    POINT    pips_to_points(PIP n){              if( (_Digits&1) == 1)   n *= 10.0;
                                                 return POINT(n);                  }
    

Saravanakumar D
360
Saravanakumar D  

Thank you brother @WHRoeder..

12
To add comments, please log in or register