Tks a lot
Attached example
Explain better what you are asking, in english please.
Explain better what you are asking, in english please.
thanks for your message. I’d like to calculate the commission amount in my ea. I marked the column I want
With some code you mean?
A coder could help you, because I can't.
thanks for your message. I’d like to calculate the commission amount in my ea. I marked the column I want
Who is this broker that gives 3.8$ commission per LOT?
Who is this broker that gives 3.8$ commission per LOT?
Tks a lot
Attached example
For MetaTrader4 you can use OrderCommission()
For MetaTrader5 you should use a bit more complex approach with the loop through all history deals and HistoryDealGetDouble(ticket,DEAL_COMMISSION)
Tks a lot
Attached example
Tow-way:
- You know the commission, asked by your broker, then you can use it in any order.
- You don't know it. Then finde it with OrderCommission(); from an existing order and apply it for other case.
Tick_Value=MarketInfo(Symbol(), MODE_TICKVALUE); int risk_percent = 10; double commision = 5; //last order commision or manualy inserted. lots = NormalizeDouble( (AccountBalance()*risk_percent/100 - 2*commision) / (Tick_Value* your_Order_sl_size), 2 );
For MetaTrader4 you can use OrderCommission()
For MetaTrader5 you should use a bit more complex approach with the loop through all history deals and HistoryDealGetDouble(ticket,DEAL_COMMISSION)
Thank you for your return Andrei. I forgot to mention, I use MT5 for the Brazilian market.
I understand that using the code below I can recover the commission amount.
int deals,i,deal_ticket; deals = HistoryDealsTotal(); for(i=0;i<deals;i++){ deal_ticket = HistoryDealGetTicket(i); Print( HistoryDealGetDouble(deal_ticket,DEAL_COMMISSION) ); }
But can I define it? This is my problem. In the code, or in the terminal, I don't think where to do this. Exist a setComission function?
Tks all
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Tks a lot
Attached example