Because the lot size refers to XAU not USD.
One Lot is (in your case) 100 units.
I think I don't understand something, but the function I mentioned above is supposed to return the point value in the account currency. Why does it work with everything but XAUUSD? How is it special?
LRDPRDX #:
I think I don't understand something, but the function I mentioned above is supposed to return the point value in the account currency. Why does it work with everything but XAUUSD? How is it special?
can you send a snapshot of the Gold chart from your terminal. Also it can vary form broker to broker. GOLD can have different number of digits in their chart. If the EA or indicator is not written in such a way to handle for GOLD then it might not work.
Also the contract size fr gold is usually different as compared with other FOREX pairs. So that also needs ot be effectively handled in the code.
double PointValue(string symbol) { double TickSize = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_SIZE); double TickValue = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE); double point = SymbolInfoDouble(symbol, SYMBOL_POINT ); double TickPerPoint = TickSize/point; double PointValue = TickValue/TickPerPoint; PrintFormat("TickSize=%f, TickValue=%f, point=%f, TickPerPoint=%f, PointValue=%f", TickSize, TickValue, point, TickPerPoint, PointValue); return(PointValue); }Hello LRDPRDX, have you found any solution to this issue? I am using the above formula and for XAUUSD, I am getting PointValue of 0.01. The demo account I am using is from ThinkMarket and value of TickSize = 0.01 and TickValue = 0.01 for XAUUSD in its specification, therefore, when i am trying to calculate lot size, for 50 point risk, i am getting 200 lots requirement. Any help would be highly appreciated!
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Second of all, I am using the following approach to calculate risks:
So, for example, the currency pair is EURUSD and the deposit currency is USD. Then this gives me
1 LOT = 100 000
pointValue = 1
And it seems correct : if I went long a 100 000 EUR's and the price have changed by 0.00001 (one point) the loss is 1$
The currency pair is EURUSD, and the deposit currency is GBP. Then the results:
1 LOT =100 000
pointValue = 0.731187
Seems correct again: I went long a 100 000 EUR's and the price have changed by 0.00001 (one point) the loss is 1$ or 0.731187 GBP
But if the pair is XAUUSD and the deposit currency is whatever it is. Then the results are always:
1 LOT = 100
pointValue = 0.1
Why is this so? Sorry if it is a stupid question