Calculation of Pips

To add comments, please log in or register
fx_maddin
108
fx_maddin  
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
Carl Schreiber
Moderator
7130
Carl Schreiber  
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!
InvestSoft
14882
Janusz Trojca  
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. 

fx_maddin
108
fx_maddin  
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
honest_knave
Moderator
2302
honest_knave  
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

whroeder1
17942
whroeder1  
    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
To add comments, please log in or register