As I'm fairly new to coding, a little input and assistance would be
appreciated since this scenario cannot be tested through backtesting.
My issue is that my EA won't open more than one order simultaneously,
even though I have it setup on 3 different pairs with different MagicNumbers.
This is the condition (before ordersend), that prevents the EA from
opening trades on other pairs if one pair already has an open order.
It also prevents opening duplicate orders which is perfectly fine.
Looks like it counts all orders on the entire account regardless of
pair and MagicNumbers.
In order to hopefully solve the issue I added the following code:
The point is: one order allowed per magicnumber.
I think this should work, but since it's impossible to backtest,
your inputs would be much appreciated.
appreciated since this scenario cannot be tested through backtesting.
My issue is that my EA won't open more than one order simultaneously,
even though I have it setup on 3 different pairs with different MagicNumbers.
This is the condition (before ordersend), that prevents the EA from
opening trades on other pairs if one pair already has an open order.
It also prevents opening duplicate orders which is perfectly fine.
Inserted Code
total=OrdersTotal(); if(total<1)
Looks like it counts all orders on the entire account regardless of
pair and MagicNumbers.
In order to hopefully solve the issue I added the following code:
The point is: one order allowed per magicnumber.
Inserted Code
total=OrdersTotal(); if(OrderMagicNumber()!=Magic) total=0; //If magic# does not equal, total will return 0 // if magic# is equal, total = OrdersTotal() if(total<1) // if total returns 0, trading is allowed.
I think this should work, but since it's impossible to backtest,
your inputs would be much appreciated.