I have wrote a EA in mql5 void onTick part, I used Ctrade library for opening positions, the EA recognize the condition correctly but it opens alot of positions at same time on one bar!
How can I set the max positions to be opened at a same time? I want it ti open like 5 open positions
Please help me with that!
Tnx in advance
- how to open 2 position together
- how to open only one position per bar?
- [Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2.
Fafar.forex:
I have wrote a EA in mql5 void onTick part, I used Ctrade library for opening positions, the EA recognize the condition correctly but it opens alot of positions at same time on one bar!
I have wrote a EA in mql5 void onTick part, I used Ctrade library for opening positions, the EA recognize the condition correctly but it opens alot of positions at same time on one bar!
How can I set the max positions to be opened at a same time? I want it ti open like 5 open positions
Please help me with that!
Tnx in advance
You can check how many items are open:
//+------------------------------------------------------------------+ //| Calculate Positions | //+------------------------------------------------------------------+ void CalculatePositions() { int total=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 properties if(m_position.Symbol()==m_symbol.Name() && m_position.Magic()==m_magic) total++; //--- return(total); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register