Calculation of Pips

 
Hi,

i am a little bit confused... MyFXBook calculate pips in trade history:

Screenshot MyFXBook


I want to calculate this "pips" in my EA oder Indicator. MyFXBook deleted my forum post, so I try to ask one of you how this value is calculated?

Thanks in Advance

Best regards

Maddin
 
fx_maddin:
Hi,

i am a little bit confused... MyFXBook calculate pips in trade history:




I want to calculate this "pips" in my EA oder Indicator. MyFXBook deleted my forum post, so I try to ask one of you how this value is calculated?

Thanks in Advance

Best regards

Maddin
Ask Prof. Dr. Google - he has a lot of literature about it!
 
fx_maddin:
Hi,

i am a little bit confused... MyFXBook calculate pips in trade history:




I want to calculate this "pips" in my EA oder Indicator. MyFXBook deleted my forum post, so I try to ask one of you how this value is calculated?

Thanks in Advance

Best regards

Maddin

I suppose, that myfxbook doesn't calculate pips value, but simply reading it from statements.

 As Carl wrote, If you need to calculate "pips" value ask uncle Google. 

 
I googled a lot of days, but I don't understand it...

This is the part of my code:
double myPoint;

int OnInit() {

    if (Digits == 5 || Digits == 3) {
        myPoint = Point*10;
    } else {
        myPoint = Point;    
    }

    return(INIT_SUCCEEDED);
}


void OnTick() {

    Comment(OrderTicket()+": " + NormalizeDouble((OrderClosePrice()-OrderOpenPrice()),Digits)/myPoint;
          
}

There is now one trade.

EURUSD | OrderOpenPrice() = 1.07028 | OrderClosePrice() = 1.07020

In Terminal, I show the Profit > as Point.

Comment (from my code) shows: 0.8
Terminal shows: 8
If I use the crosshair to messure the distance, it shows also 8

Therefore I am confused...

Please give me a hint, what is wrong in my calculation or do I have thinking errors??

thanks in advance
 
fx_maddin:
double myPoint;

int OnInit() {

    if (Digits == 5 || Digits == 3) {
        myPoint = Point*10;
    } else {
        myPoint = Point;    
    }

    return(INIT_SUCCEEDED);
}


void OnTick() {

    Comment(OrderTicket()+": " + NormalizeDouble((OrderClosePrice()-OrderOpenPrice()),Digits)/myPoint;
          
}

There is now one trade.

EURUSD | OrderOpenPrice() = 1.07028 | OrderClosePrice() = 1.07020

In Terminal, I show the Profit > as Point.

Comment (from my code) shows: 0.8
Terminal shows: 8
If I use the crosshair to messure the distance, it shows also 8

MetaTrader works in points not pips.

Many people are trading forex with a 5 digit broker. Your broker quotes EURUSD to 5 digits: 1.07028

On 5 digit brokers, there are 10 points to a pip.

So, your code is correct (see parts highlighted in yellow).

8 points = 0.8 pips

 
    Comment(OrderTicket()+": " + NormalizeDouble((OrderClosePrice()-OrderOpenPrice()),Digits)/myPoint;
  1. You can not use any Trade Functions - MQL4 Reference unless you select a ticket first.
  2. Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong
Reason: