If you want to use MQL you need to open a generated ea with MetaEditor and understand how it works From a generated EA I got this: if (CalculateOpenPositions(symbol_bn,ordertype_bn,magic_bn)>=MaxNumberofPositions) { Print("I-Warning : Can not execute new ",OrderTypetoString(ordertype_bn)," order for Symbol ",symbol_bn,". Maximum number of ",MaxNumberofPositions," open positions reached."); return(0); }
In the MQL icon in version 3.2 or higher (won't work in old versions) you need to put something like: CalculateOpenPositions(symbol_bn,ordertype_bn,magic_bn)>=MaxNumberofPositions
You need to replace symbol_bn,ordertype_bn,magic_bn and MaxNumberofPositions with your own info Like CalculateOpenPositions("EURUSD",OP_BUY,your ea magic number)>=1
unfortunately we do not do MQL support here or teach MQL - we only do product support so you have to do a lot of try and error on your end.
We do not have any examples but I have seen some posts in the forum with some MQL code
|