i need the possible profit in account currency before doing a trade, as most exact as possible.
My mistake is a thinking error.
I just put entry and exit price of a trade in my formular and it was not matching to the profit exposed for this trade in backtest log.
The reason for this seems to be that
SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_VALUE)
depends on CURRENT market as it reflects current exchange value for symbol-currency against account currency.
my formular:
double _SYMBOL_POINT=SymbolInfoDouble(symbol,SYMBOL_POINT);
double _SYMBOL_TRADE_TICK_SIZE=SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_SIZE);
/// so, this value can change every tick as it reflects value against account currencydouble _SYMBOL_TRADE_TICK_VALUE=SymbolInfoDouble(symbol,SYMBOL_TRADE_TICK_VALUE);
double point_value= _SYMBOL_TRADE_TICK_VALUE / (_SYMBOL_TRADE_TICK_SIZE/ _SYMBOL_POINT);
double price_diff=p1-p2;
double nbr_pips=price_diff / _SYMBOL_POINT;
double costs_for_std_lot_symbol=nbr_pips * point_value;
Yes, TICK_VALUE depends on "current exchange value for symbol-currency against account currency". Unless profit currency and account currency are the same.
But it also depends if your trade is in profit or in loss, this why there is SYMBOL_TRADE_TICK_VALUE_PROFIT and SYMBOL_TRADE_TICK_VALUE_LOSS. Your formula is right for a profit.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
It should not have been made available free in the first place. My err in judgement. Sorry.
Hello Angevoyageur,
i need the possible profit in account currency before doing a trade, as most exact as possible.
My mistake is a thinking error.
I just put entry and exit price of a trade in my formular and it was not matching to the profit exposed for this trade in backtest log.
The reason for this seems to be that
depends on CURRENT market as it reflects current exchange value for symbol-currency against account currency.
my formular:
...
Yes, TICK_VALUE depends on "current exchange value for symbol-currency against account currency". Unless profit currency and account currency are the same.
But it also depends if your trade is in profit or in loss, this why there is SYMBOL_TRADE_TICK_VALUE_PROFIT and SYMBOL_TRADE_TICK_VALUE_LOSS. Your formula is right for a profit.
Hello,
thank you for this detail. Will integrate this in my formular.