Alexey Volchanskiy: So the commission can only be found out after the position is closed? But it is taken at the opening, at least on ECN accounts in alpe and robo. That's not good.
No, think about the concept of "trades". Above is a working source. Take a close look at it.
The POSITION_COMMISSION property in the tester (RoboForexEU-MetaTrader 5) always returns zero commission.
//+------------------------------------------------------------------+//| Get the property value "POSITION_COMMISSION" |//+------------------------------------------------------------------+double CPositionInfo::Commission(void) const
{
return(PositionGetDouble(POSITION_COMMISSION));
}
Also POSITION_COMMISSION (== 8) is missing in the help and meta-editor (highlighting), but is familiar to the compiler. The position commission is not difficult to determine using another (working) method. Is the POSITION_COMMISSION property a rudiment?
You have the defines commented out at the end there, is that correct?
Yes, that's how it should be. It's done on purpose to show that it's not allowed - see comments inside.
One more thing. I will be posting a video in my blog on YouTube, showing the conversion from MQL4 to MQL5. How do you mind if I show your library too? And a link to kodobase of course.
And there is no such property in documentation, but it compiles ) This is all there is in the terminal's help.
POSITION_VOLUME
Position volume
double
POSITION_PRICE_OPEN
Position price
double
POSITION_SL
Stop loss level for open position
double
POSITION_TP
Take Profit level for open position
double
POSITION_PRICE_CURRENT
Current price for the symbol
double
POSITION_SWAP
Accumulated swap
double
POSITION_PROFIT
Current profit
double
This is what I'm talking about.
Alexey Volchanskiy: So the commission can be seen only after closing the position? But it is taken at opening, at least for ECN accounts in alp and robo. This is not good.
I couldn't even find the "Commission" column in my trading account but I had it in History and it was filled in the rows of deals. That's why I started looking for commission in HistoryDealGetDouble. And the commission is taken twice. 1 when opening a position and 2 when closing a position.
The "Trading" tab does not even have the "Commission" column, but the "History" has it and it is filled in the rows of trades. That is why I started looking for commission in HistoryDealGetDouble. And the commission is taken twice. 1 at position opening and 2 at position closing.
Yes, I noticed that there are no commissions in Trading. I guess I'm judging from MT4, there is and commission is taken immediately and in full (open+close) when an order is opened. Just recently switched to MT5, due to opening a hedge, hence such questions )
As you all already know, both MetaTrader 4 and MetaTrader 5 provide MQL Wizard for easy code generation. Between these 2 wizards there is one important difference though. MetaTrader 5 allows you to...
Alexey Volchanskiy: In a nutshell - does this package translate any MT5->MT4 code or just the whizards MT5? I don't need mt5 visards.
It makes the Wizard one work without any changes, as it is. You can write order functions and some other functions in MQL5 through plug-in. It would be easier to write the question to the author.
fxsaber: It makes the Wizard one work without any changes - as is. And so you can write order functions and some other functions in MQL5 through plugin. It would be easier to write the question to the author.
The work is similar to yours, only in the opposite direction.
So the commission can only be found out after the position is closed? But it is taken at the opening, at least on ECN accounts in alpe and robo. That's not good.
And there is no such property in documentation, but it compiles ) This is all there is in the terminal's help.
POSITION_VOLUME
Position volume
double
POSITION_PRICE_OPEN
Position price
double
POSITION_SL
Stop loss level for open position
double
POSITION_TP
Take Profit level for open position
double
POSITION_PRICE_CURRENT
Current price for the symbol
double
POSITION_SWAP
Accumulated swap
double
POSITION_PROFIT
Current profit
double
Forum on trading, automated trading systems and trading strategies testing
Bugs, bugs, questions
fxsaber, 2016.07.19 12:40
The POSITION_COMMISSION property in the tester (RoboForexEU-MetaTrader 5) always returns zero commission.
Also POSITION_COMMISSION (== 8) is missing in the help and meta-editor (highlighting), but is familiar to the compiler. The position commission is not difficult to determine using another (working) method. Is the POSITION_COMMISSION property a rudiment?
You have the defines commented out at the end there, is that correct?
Yes, that's how it should be. It's done on purpose to show that it's not allowed - see comments inside.
One more thing. I will be posting a video in my blog on YouTube, showing the conversion from MQL4 to MQL5. How do you mind if I show your library too? And a link to kodobase of course.
And there is no such property in documentation, but it compiles ) This is all there is in the terminal's help.
POSITION_VOLUME
Position volume
double
POSITION_PRICE_OPEN
Position price
double
POSITION_SL
Stop loss level for open position
double
POSITION_TP
Take Profit level for open position
double
POSITION_PRICE_CURRENT
Current price for the symbol
double
POSITION_SWAP
Accumulated swap
double
POSITION_PROFIT
Current profit
double
This is what I'm talking about.
So the commission can be seen only after closing the position? But it is taken at opening, at least for ECN accounts in alp and robo. This is not good.
I couldn't even find the "Commission" column in my trading account but I had it in History and it was filled in the rows of deals. That's why I started looking for commission in HistoryDealGetDouble. And the commission is taken twice. 1 when opening a position and 2 when closing a position.
This is what I was talking about.
The "Trading" tab does not even have the "Commission" column, but the "History" has it and it is filled in the rows of trades. That is why I started looking for commission in HistoryDealGetDouble. And the commission is taken twice. 1 at position opening and 2 at position closing.
Forum on trading, automated trading systems and trading strategies testing
Discussion on "Switching from MQL4 to MQL5" article
fxsaber, 2016.09.29 06:11
More on the topic.
Reverse Translation: MQL5 -> MQL4. MT5 Wizard at the service of MT4!
Reverse Translation: MQL5 -> MQL4. MT5 Wizard at the service of MT4!
In a nutshell - does this package translate any MT5->MT4 code or just the whizards MT5? I don't need mt5 visards.
Reverse Translation: MQL5 -> MQL4. MT5 Wizard at the service of MT4!
It makes the Wizard one work without any changes - as is. And so you can write order functions and some other functions in MQL5 through plugin. It would be easier to write the question to the author.