pipValue = pipDistance * TickValue / TickeSize.
I know this line is not correct, and i'll change it.
but my problem is above in line
double TickValue = SymbolInfoDouble(symbol, SYMBOL_TRADE_TICK_VALUE);
what's wrong ?... Why i get the value i posted. ? it's my fault ?
Hi William ,
I know this line is not correct, and i'll change it.
but my problem is above in line
what's wrong ?... Why i get the value i posted. ? it's my fault ?
This value is set by the broker on the server side. It's not rare it's wrong. The solution is to calculate it yourself or...
Ask your broker to fix it.
Try the following Script (not EA) and show us the results of the Experts log ...
#property script_show_inputs input string sSymbol = "XAUUSD"; void OnStart() { string sAccountCurrency = AccountInfoString( ACCOUNT_CURRENCY ); double dbTickValue = SymbolInfoDouble( sSymbol, SYMBOL_TRADE_TICK_VALUE ); PrintFormat( "Tick value of %s is %.8f %s", sSymbol, dbTickValue, sAccountCurrency ); };
I get the following ...
2023.03.31 12:47:03.647 TestCalc (EURUSD,H1) Tick value of XAUUSD is 0.91974321 EUR
Wile i was trying to set my EA code for a strategy in AUXUSD I get a strange value for SYMBOL_TRADE_TICK_VALUE, spcifically this is my code snippet :
It looks as though (a) you are misunderstanding the meaning of the tick value, but (b) the figure being reported is nevertheless wrong.
It is meant to be the same as the old MODE_TICKVALUE: the value, in your deposit currency, of a change in price by the tick size when trading 1 lot. For example, when trading 1 lot (100,000) of EUR/USD, with a tick size of 0.00001, then each change by the tick size is worth $10, and SYMBOL_TRADE_TICK_VALUE will be $10 converted from USD to your deposit currency. The current price is immaterial. The value is not something like 1 / 1977.34.
But the value of 0.10 which you are reporting is nevertheless incorrect. That is clearly in USD, whereas it should be converted to your EUR deposit currency. I don't think that I have ever seen this on MT5, but it is quite common on MT4 when brokers configure their non-fx markets in a way which works for profit calculations but breaks the data reported to EAs via MODE_TICKVALUE / SYMBOL_TRADE_TICK_VALUE. Your only option, if your broker has done this, is to do your own calculation.
Hi alain ,
ok , so it's for sure not my fault.
That said. Ho can I calculate on my own ? is there a command like "GETCURRENT_TICK_PRICE" or something like? so that i can calculate like 1/ "GETCURRENT_TICK_PRICE"
or you have any other suggestion ?
or you have any other suggestion ?
That has not been confirmed yet. Please run my example Script and report the results so we can confirm the situation.
It looks as though (a) you are misunderstanding the meaning of the tick value, but (b) the figure being reported is nevertheless wrong.
It is meant to be the same as the old MODE_TICKVALUE: the value, in your deposit currency, of a change in price by the tick size when trading 1 lot. For example, when trading 1 lot (100,000) of EUR/USD, with a tick size of 0.00001, then each change by the tick size is worth $10, and SYMBOL_TRADE_TICK_VALUE will be $10 converted from USD to your deposit currency. The current price is immaterial. The value is not something like 1 / 1977.34.
But the value of 0.10 which you are reporting is nevertheless incorrect. That is clearly in USD, whereas it should be converted to your EUR deposit currency. I don't think that I have ever seen this on MT5, but it is quite common on MT4 when brokers configure their non-fx markets in a way which works for profit calculations but breaks the data reported to EAs via MODE_TICKVALUE / SYMBOL_TRADE_TICK_VALUE. Your only option, if your broker has done this, is to do your own calculation.
Wrong, it's 1$.
Hi fernando ,
I run the script and this is the result :
2023.03.31 13:58:04.000 TestTickValue (@CLE,H1) Tick value of XAUUSD is 0.10000000 EUR
- 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 to alla guys ,
Wile i was trying to set my EA code for a strategy in AUXUSD I get a strange value for SYMBOL_TRADE_TICK_VALUE, spcifically this is my code snippet :
my deposit currency is in EUR , i checked with Print("Deposit currency = ",AccountInfoString(ACCOUNT_CURRENCY));
2023.03.31 12:03:01.530 XAUUSD_GPT4 Deposit currency = EUR
could some one give me some light where isthe mistake ?
thanks