In MetaEditor, in the "Tools" window, go to the "Public Projects" tab, in the "Name" column on the "AlligatorAndStochastic" project, right click and select the "Join" item
Thanks a million. I eventually found a way around it focusing on Equity drawdown as my variable. I really appreciate your assistance and will not hesitate to engage you, or any other available programmer in case you were extremely busy when required, for paid project if/when I have anyone I cannot code by myself.
if you please how to calculate order commision with profit to be like this
" Profit += profit + swap + commision "
Example for positions:
//+------------------------------------------------------------------+//| Profit all positions |//+------------------------------------------------------------------+double ProfitAllPositions(void)
{
double profit=0.0;
for(int i=PositionsTotal()-1; i>=0; i--)
if(m_position.SelectByIndex(i)) // selects the position by index for further access to its propertiesif(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==InpMagic)
profit+=m_position.Commission()+m_position.Swap()+m_position.Profit();
//---return(profit);
}
i used this class everything is ok except commission
can you check my code please
note: my broker count commision at tow side one when open and other when close
In this case, you need to work with trade history - you need to make a request for historical trades. Please note: until the position is closed, you will not know the full commission.
For example like this:
//+------------------------------------------------------------------+//| Profit for the period |//+------------------------------------------------------------------+double ProfitForPeriod(constdatetime from_date,constdatetime to_date)
{
double result=0.0;
//--- request trade historyHistorySelect(from_date,to_date);
//---uint total=HistoryDealsTotal();
ulong ticket=0;
long position_id=0;
//--- for all dealsfor(uint i=0; i<total; i++) // for(uint i=0;i<total;i++) => i #0 - 2016, i #1045 - 2017
{
//--- try to get deals ticketif((ticket=HistoryDealGetTicket(i))>0)
{
//--- get deals propertieslong deal_type =HistoryDealGetInteger(ticket,DEAL_TYPE);
long deal_entry =HistoryDealGetInteger(ticket,DEAL_ENTRY);
long deal_magic =HistoryDealGetInteger(ticket,DEAL_MAGIC);
double deal_commission =HistoryDealGetDouble(ticket,DEAL_COMMISSION);
double deal_swap =HistoryDealGetDouble(ticket,DEAL_SWAP);
double deal_profit =HistoryDealGetDouble(ticket,DEAL_PROFIT);
string deal_symbol=HistoryDealGetString(ticket,DEAL_SYMBOL);
//--- only for current symbol and magicif(deal_magic==InpMagic && deal_symbol==m_symbol.Name())
if(ENUM_DEAL_TYPE(deal_type)==DEAL_TYPE_BUY || ENUM_DEAL_TYPE(deal_type)==DEAL_TYPE_SELL)
result+=(deal_commission+deal_swap+deal_profit);
}
}
//---return(result);
}
In this case, you need to work with trade history - you need to make a request for historical trades. Please note: until the position is closed, you will not know the full commission.
For example like this:
i really appreciate your help thank you
i will explane an example and correct me if i am wrong
i opened an order at EURUSD with 1 Lot first commision at opening is 2.32$ after close the same commision 2.32$ so now total commision is 4.64$
when i code profit counting can i make commision * 2 or not ?
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.
New Project 'Andromeda Nebula' is already running (version 1.002).
New Project 'Andromeda Nebula'
How to join the project
In MetaEditor, in the "Tools" window, go to the "Public Projects" tab, in the "Name" column on the "AlligatorAndStochastic" project, right click and select the "Join" item
Thanks a million. I eventually found a way around it focusing on Equity drawdown as my variable. I really appreciate your assistance and will not hesitate to engage you, or any other available programmer in case you were extremely busy when required, for paid project if/when I have anyone I cannot code by myself.
Check: is it allowed to use 'Close By' on the symbol or is it forbidden?
Code: 'Check SYMBOL_ORDER_MODE.mq5'
This script can be modified and leave only the lines you need.
Here is an example of launching on two symbols: on one symbol all order types are allowed,
but on the other 'Close By' is prohibited:
EURUSD_closeby Market orders allowed EURUSD_closeby Limit orders allowed EURUSD_closeby Stop orders allowed EURUSD_closeby Stop-limit orders allowed EURUSD_closeby Stop Loss allowed EURUSD_closeby Take Profit allowed EURUSD_closeby Close By operations prohibitedif you please how to calculate order commision with profit to be like this
" Profit += profit + swap + commision "
if you please how to calculate order commision with profit to be like this
" Profit += profit + swap + commision "
Example for positions:
CPositionInfo Trade class used
Example for positions:
CPositionInfo Trade class used
i used this class everything is ok except commission
can you check my code please
note: my broker count commision at tow side one when open and other when close
i used this class everything is ok except commission
can you check my code please
note: my broker count commision at tow side one when open and other when close
In this case, you need to work with trade history - you need to make a request for historical trades. Please note: until the position is closed, you will not know the full commission.
For example like this:
In this case, you need to work with trade history - you need to make a request for historical trades. Please note: until the position is closed, you will not know the full commission.
For example like this:
i really appreciate your help thank you
i will explane an example and correct me if i am wrong
i opened an order at EURUSD with 1 Lot first commision at opening is 2.32$ after close the same commision 2.32$ so now total commision is 4.64$
when i code profit counting can i make commision * 2 or not ?
and use this
instead of use history
i really appreciate your help thank you
i will explane an example and correct me if i am wrong
i opened an order at EURUSD with 1 Lot first commision at opening is 2.32$ after close the same commision 2.32$ so now total commision is 4.64$
when i code profit counting can i make commision * 2 or not ?
and use this
instead of use history
Show the "trade" tab of your terminal - I'm interested in what you write in the "Commission" column.
Show the "trade" tab of your terminal - I'm interested in what you write in the "Commission" column.