Thanks for the code. I got it working now.
One more thing if you can help me out.
Right now my EA opens one trade at a time. it will open another order if the first one is closed. I want it to keep opening orders if there are more then one trade setup while the current trade is open and wating for tp or sl.
i.e: trading eur/usd i want it to keep opening both long and short positions even if i have trades already opened in eur/usd
i tried to use this code it did not helped
extern int MaxTrades = 10;
can u plz help me out. thanks in advance