I am trying to open 2 orders in my EA ( Same chart at Same time )
Reason : One order use Take Profit amount and the other one do not set Take Profit amount ( I set this to 0 ) as this order will do trailing stop later.
I used 2 different MagicNumbers to differentiate the orders.
However, when I run EA on the strategy tester it opens only one order.
Can some one help me to fix this.
Pretty obvious, you cannot have this line in both BuyOrder() and SecondBuyOrder():
OrdersTotal() == 0
Since after BuyOrder() this check will return 1, so your SecondBuyOrder() will never get to open any new order.
Perhaps you can change the one in SecondBuyOrder() to:
OrdersTotal() == 1
Pretty obvious, you cannot have this line in both BuyOrder() and SecondBuyOrder():
Since after BuyOrder() this check will return 1, so your SecondBuyOrder() will never get to open any new order.
Perhaps you can change the one in SecondBuyOrder() to:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I am trying to open 2 orders in my EA ( Same chart at Same time )
Reason : One order use Take Profit amount and the other one do not set Take Profit amount ( I set this to 0 ) as this order will do trailing stop later.
I used 2 different MagicNumbers to differentiate the orders.
However, when I run EA on the strategy tester it opens only one order.
Can some one help me to fix this.