Factor to convert Pips to US Dollars

 

Hi All,

I would like some code or function to get the Factor for any currency pair.

I would use the factor to calculate the dollars of Profit/Loss for any given Lot size.


For Example:

Currency:  EURUSD

Lot Size:   1.0

Pips Move:  +100

CalcDollars = 100 * (Factor @ 1.0 Lot)

If calculated Factor = 1.15


CalcDollars = 100*(1.15)

CalcDollars= +$115 Profit

Does anyone have some code to get this Factor?

Many Thanks

rcrill

 

Any pair ending in USD , 1 pip move is worth $10 for 1 lot

XXXCAD, is 10 CAD

XXX GBP is 10 GBP

 
  1. AccountBalance * percent/100 = RISK = OrderLots * (|OrderOpenPrice - OrderStopLoss| * DeltaPerLot + CommissionPerLot) (Note OOP-OSL includes the spread, and DeltaPerLot is usually around $10/pip but it takes account of the exchange rates of the pair vs. your account currency.)
  2. Do NOT use TickValue by itself - DeltaPerLot and verify that MODE_TICKVALUE is returning a value in your deposit currency, as promised by the documentation, or whether it is returning a value in the instrument's base currency.
              MODE_TICKVALUE is not reliable on non-fx instruments with many brokers - MQL4 programming forum 2017.10.10
              Is there an universal solution for Tick value? - Currency Pairs - General - MQL5 programming forum 2018.02.11
              Lot value calculation off by a factor of 100 - MQL5 programming forum 2019.07.19
  3. You must normalize lots properly and check against min and max.
  4. You must also check FreeMargin to avoid stop out

Most pairs are worth about $10 per PIP. A $5 risk with a (very small) 5 PIP SL is $5/$10/5 or 0.1 Lots maximum.

Substitute size of a PIP and solve.
 
Keith Watford:

Any pair ending in USD , 1 pip move is worth $10 for 1 lot

XXXCAD, is 10 CAD

XXX GBP is 10 GBP

Thank you Keith
 
William Roeder:
Substitute size of a PIP and solve.

WOW!

Nothing is simple as it seems.

I will have to study this.

I was hoping that I could use an Existing function that would just give me the Pre-Calculated Factor

Thanks William



Thanks

Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
//| Expert initialization function                                   | //| Expert deinitialization function                                 | //| Expert tick function                                             | //| test1                                                            |...