You are missing one below
//+------------------------------------------------------------------+ //| Calculate open positions | //+------------------------------------------------------------------+ int CalculateCurrentOrders(string symbol) { int buyCount=0,sellCount=0; //--- for(int i=0;i<OrdersTotal();i++) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false) break; if(OrderSymbol()==Symbol() && OrderMagicNumber()==MAGICMA) { if(OrderType()==OP_BUY) buyCount++; if(OrderType()==OP_SELL) sellCount++; } } //--- return orders volume if(buyCount>0) return(buyCount); else return(-sellCount); } <--- //+------------------------------------------------------------------+Using the styler
Using the styler can help.
Marco vd Heijden:
Now it Shows more Then 20 errors , Can you please look into it. Thanks in advance
You are missing one below
Using the styler can help.
What is utlity of this ?
void CheckForNewTrader() { //Fast moving average cross up to slow moving average //Buy position // for order check if (OrdersTotal()<1) { } {
And this ?
&& if int BarCount;
You have a lot of error open/close bracket, please clean up and justify your code for lisibility, you will find error more easily.
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
i am having a issue with this program. i am trying to make an ea which should open a trade when Ma crosses and should have gap in them ,if these two conditions met then should open trade on end of current candle/bar , but this ea opens so many trades buy and sell at same time. Please help .