
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi,
I am trying to figure out a way to write a MQL4 a kind of Hedging to compensate for an order that wen bad.
I will detail.
This order backfires and the Virtual Stop Loss, that is not a Stop Loss in my case but a value to fire compensating order, is 22 pips from Open Price of Order 1, meaning the value of 1,0909.
My difficulty is how should I calculate X so the profits Order 2 must be equals the (Profits of Order 1 if it hd reached its TP) + (Loss of Order 1 at TP of Order 2).
So, If I call:
PROFIT2 = (OP1 - TP2) * 10 * LS1+ (TP1 - OP1) * 10 * LS1= (TP1 - TP2)* 10 * LS1
PROFIT2 = (OP2 - TP2) * 10 * LS2
LS2= LS1* (TP1 - TP2)/(OP2 - TP2)
Am I missing anything?
Will it work for any pair or instrument?
How can I make it robust to be used on any instrument?