Issue with TotalOrdersCount

Back to topics list To post a new topic, please log in or register
avatar
8
jcalow 2016.03.18 16:42
 

I want my EA to only place up to 3 trades, and only once 1 manual trade is already open.

Currently I have set up an external variable of TotalTrades and set this to 3. This is limiting the max trades to 3. I can't seem to work out how to set the requirement of 1 trade already open though.

I effectively want 1< & <TotalTrades but can't seem to get his working.

Any help would be greatly appreciated.

My current if statement is as below:

if( TotalOrdersCount()<TotalTrades ) 
  {
avatar
Moderator
3418
GumRai 2016.03.18 22:01 #
 

There is no standard function called TotalOrdersCount()

Loop through the orders and check OrderMagicNumber(), if it is 0, then the trade was placed manually. This will, of course only work if all trades placed by EAs use a magic number that !=0

avatar
872
eevviill 2016.03.18 23:38 #
 
GumRai:

There is no standard function called TotalOrdersCount()

Loop through the orders and check OrderMagicNumber(), if it is 0, then the trade was placed manually. This will, of course only work if all trades placed by EAs use a magic number that !=0

And it is bad. I propose many times to add finction like OrdersTotal(int type=-1,int magic=-1)
Back to topics list  

To add comments, please log in or register