Hey guys,
Nice to meet you all. I'm new to the forum
I want to create an Expert Advisor (Hedging EA) for the conditions below:
1. For Buy Order
- 0.01 lot
- SL = 0, TP = 30 pips
If the price goes down to 30 pips below the open price of the Buy Order, it will:
--> Sell immediately:
- 0.03 lot
- SL = 30 pips, TP = 30 pips
AND
--> Modify previous Buy Order
- SL = 60 pips, TP = 0 pips
2. The converse for Sell Order is true.
Below is my code of this EA
The problem of this EA is that it does not hedge by opening orders of opposite position. Can anyone look into it and help me with the code?
Hello,
you did not state the condition for hedging what you did is that after your initial Buy/Sell you checked for opened orders and if any found it should modify and open an opposite positions, that wont work.
you need to create a function that will read if your current Buy/Sell position is 30 pips negative from the open price then if true it should open an opposite position and modify the previous position.
this should solve it
i hope you found this helpful.
Hey guys,
Nice to meet you all. I'm new to the forum
I want to create an Expert Advisor (Hedging EA) for the conditions below:
1. For Buy Order
- 0.01 lot
- SL = 0, TP = 30 pips
If the price goes down to 30 pips below the open price of the Buy Order, it will:
--> Sell immediately:
- 0.03 lot
- SL = 30 pips, TP = 30 pips
AND
--> Modify previous Buy Order
- SL = 60 pips, TP = 0 pips
2. The converse for Sell Order is true.
Below is my code of this EA
The problem of this EA is that it does not hedge by opening orders of opposite position. Can anyone look into it and help me with the code?