Count number of oders
MQL4 or MQL5 ?
MT4
In future please post in the correct section.
I will move your topic to the MQL4 and Metatrader 4 section.
Please edit your post and
use the code button (Alt+S) when pasting code
if( OrderTotal() <=4) { //here goes code }
Do you mean OrdersTotal() ??
YEP
-
Don't double post! You already had this thread open.
General rules and best pratices of the Forum. - General - MQL5 programming forum 2017.07.19 - shaikh_shafique: YEPDon't post code that won't even compile. If you want help with your code, post your code.
Do not double post!
I have deleted your duplicate topic.
if( OrdersTotal() <=4) { //If there are 5 or more orders currently open this block of code will not be executed //So if new orders are opened and there are already 5 orders currently open, the new orders are not being opened in this block of code. }
If you want to limit it to no more than 4 currently open orders you should use
if( OrdersTotal() <4)
Hello,
Currently i am trying to limit number of order to 4, opened by EA using OrderTotal() but still EA opens more then 4 orders
here is snippet
if( OrderTotal() <=4)
{
//here goes code
}
Please help