You must expand the OrdersTotal () definition. For example, with the name Symbol ().
liamsean000:
I know that it is not obvious, but topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
Don't use NULL.
- On MT4, you can use NULL in place of _Symbol only in those calls that the documentation specially says you can. iHigh does, iCustom does, MarketInfo does not. OrderSend does not.
- Don't use NULL (except for pointers where you explicitly check for it.) Use _Symbol and _Period, that is minimalist as possible and more efficient.
- Zero is the same as PERIOD_CURRENT which means _Period. Don't hard code numbers.
- MT4: No need for a function call with iHigh(NULL,0,s) just use the predefined arrays, i.e. High[].

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
Hi all, I am having difficulties with my code.
I would like it to open one order per currency pair but currently it only opens one order for the whole platform, can anyone guide me as to how i could adjust my code to open one trade per currency pair.
this is what i have currently got going,
if (signal=="BUY" && OrdersTotal()==0)
OrderSend (NULL,OP_BUY,.10,Ask,0,(Ask-ATRLoss),(Ask+ATRProfit),NULL,0,0,Green);
if (signal=="SELL" && OrdersTotal()==0)
OrderSend (NULL,OP_SELL,.10,Bid,0,(Bid+ATRLoss),(Bid-ATRProfit),NULL,0,0,Red);