Calculation of Pips
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
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.
This is the part of my code:
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
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
- You can not use any Trade Functions - MQL4 Reference unless you select a ticket first.
- Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't
use it. It's use is always
wrong
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 forum
- Open price for pending orders need to be adjusted. On Currencies, Point == TickSize, so you will get the same answer, but it won't work on Metals. So do it right: Trailing Bar Entry EA - MQL4 forum or Bid/Ask: (No Need) to use NormalizeDouble in OrderSend - MQL4 forum
- Lot size must also be adjusted to a multiple of LotStep. If that is not a power of 1/10 then NormalizeDouble is wrong. Do it right.
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