-
Yes.
Only ask questions with yes/no answers if you want “yes” or “no” as the answer. -
MT4: orders are everything, MT5: orders are pending only. Opened orders are deals.
If you don't learn MQL4/5, there is no common language for us to communicate. If we tell you what you need, you can't code it. If we give you the code, you don't know how to integrate it into your code.
Show us your attempt (using the CODE button) and state the nature of your difficulty.
No free help (2017)Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
No free help (2017)
Hi is there someone who can translate this MQL4 code into MQL5 ?
Why have a parametrized function (symbol as arguments) if it would not be used.
//+------------------------------------------------------------------+ //| Calculate open positions. | //+------------------------------------------------------------------+ int CalculateCurrentOrders(string symbol) { int buys=0, sells = 0; ulong ticket = 0; for(int i=0; i<PositionsTotal(); i++) { ticket = PositionGetTicket(i); if(ticket>0) { if(PositionSelectByTicket(ticket)) { string sym = PositionGetSymbol(POSITION_SYMBOL); int mag_no = PositionGetInteger(POSITION_MAGIC); ENUM_POSITION_TYPE type = PositionGetInteger(POSITION_TYPE); if(sym==Symbol()&& mag_no==MAGICMA) { if(type == POSITION_TYPE_BUY) buys++; else sells++; } } } } return buys; }
then I returned only the buys, you can copy your existing logic and input it there, but the logic is not too clear, why count sells and buys only to return one.
Look up CPosition class it can be used to reduce the above, when you understand it.
- 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 is there someone who can translate this MQL4 code into MQL5 ?