Multiplying a change in price by 5 doesn't convert it to PIPs.
PIP, Point, or Tick are all different in general.
What is a TICK? - MQL4 programming forum
Unless you manually adjust your SL/TP for each separate symbol, using Point means code breaks on 4 digit brokers, exotics (e.g. USDZAR where spread is over 500 points,) and metals. Compute what a PIP is and use it, not points.
How to manage JPY pairs with parameters? - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum
Multiplying a change in price by 5 doesn't convert it to PIPs.
PIP, Point, or Tick are all different in general.
What is a TICK? - MQL4 programming forum
Unless you manually adjust your SL/TP for each separate symbol, using Point means code breaks on 4 digit brokers, exotics (e.g. USDZAR where spread is over 500 points,) and metals. Compute what a PIP is and use it, not points.
How to manage JPY pairs with parameters? - MQL4 programming forum
Slippage defined in index points - Currency Pairs - Expert Advisors and Automated Trading - MQL5 programming forum
Hi William,
Now I getting headache by read this.... Too complicate... I think I am poor english or I am newbie stock market and programming.... I guess I need to study more but headache already.
I think my code way is wrong... or not sure...
extern double lotsize=0;
extern double amount=0;
double BuyValue;
double SellValue;
double TotalChangeLoss;
double TotalChangeProfit;
double PerPipValue;
double PerPipValue1;
int OnInit()
{
//--- indicator buffers mapping
Print("Current Marketinfo Bid ",MarketInfo("EURUSD",MODE_BID));
Print("Current Marketinfo Ask ",MarketInfo("EURUSD",MODE_ASK));
Print("Lot Size is ",lotsize,". Base of Currency Amount EUR Dollar is ",DoubleToStr(amount,0));
BuyValue=lotsize*amount*MarketInfo("EURUSD",MODE_BID);
SellValue=lotsize*amount*MarketInfo("EURUSD",MODE_ASK);
Print("Bid Value is ",BuyValue);
Print("Ask Value is ",SellValue);
TotalChangeLoss=BuyValue-SellValue;
TotalChangeProfit=SellValue-BuyValue;
Print("Total Change Loss is $",DoubleToStr(TotalChangeLoss,0)," USD Dollar");
Print("Total Change Profit is $",DoubleToStr(TotalChangeProfit,0)," USD Dollar");
PerPipValue=(TotalChangeLoss/(BuyValue-SellValue));
Print("Per Pip Value is $",DoubleToStr(PerPipValue,0)," Loss");
PerPipValue1=(TotalChangeProfit/(SellValue-BuyValue));
Print("Per Pip Value is $",DoubleToStr(PerPipValue1,0)," Profit");
//---
return(INIT_SUCCEEDED);
}
I think my code way is wrong... or not sure...
-
Please edit your (previous) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - No question or problem stated. No reply needed.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi, I am learning programming mql4 as newbie
I know only simple basic. but deep advanced that i still not sure.
My project is
1) counted total iBar in select Date/Time from Start to End. I able to do this.
2) counted total of range = iHigh - iLow = total range. I able to do this.
3) Calculated Pips - Total range*Digits. I able to do this.
But
4) total iBar of Pips from Start to End....
Example Pips each of one iBar from Start to End need calulcate total Pips
(I don't know how to do) I think something relate loop or for or if else??? I dun understand how to work.
Here of code