- MQL5 Wizard: Development of trading robots for MetaTrader 5
- Trading Robots and Technical Indicators in MetaTrader 5
- MetaEditor - Professional editor of trading applications
Hi. I coded an expert to calculate the new lot size after every position. Problem is, the calculated lot is not used in the immediate next trade. It comes second. Can anyone help me find a better way of doing it? Seems I have been using a wrong approach, for way too long. I can't think no more. D(:
I bet some one will help you out when you post the code of your problem involved
I bet some one will help you out when you post the code of your problem involved
Hi. I coded an expert to calculate the new lot size after every position. Problem is, the calculated lot is not used in the immediate next trade. It comes second. Can anyone help me find a better way of doing it? Seems I have been using a wrong approach, for way too long. I can't think no more. D(:
Hi. I coded an expert to calculate the new lot size after every position. Problem is, the calculated lot is not used in the immediate next trade. It comes second. Can anyone help me find a better way of doing it? Seems I have been using a wrong approach, for way too long. I can't think no more. D(:
There are too many hidden data why you need it the second.. The idea is to broad to be answered. but if it's like that I guess having a 2nd variable would help you then
I managed. My lotsize was to be recalculated before a new position opens. I had to declare lot as a global variable, give it a value when no position is present, then reset it to zero when a position exists. Otherwise, the previous lot was being used before the lot was calculated for recently closed position. For trade execution function, I did this:
bool Trade(double &Ask, double &Bid) // I have been having trouble with the m_symbol.Ask()|| __.Bid() returning zero. { if(Lots==0) return(false); }
Thank you everyone for you consistent help.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use