Russell,
I know you are asking for help here yourself, but (if I may) it seems like you have a similar hedge challenge as I do. I'm trying to automate Stop and Limit entry so that I can place an order and achieve a stop that's X times the spread doubled, and a Limit that's X + 1 times the spread doubled PLUS one pip. (So if the spread for a Buy is 2 pips, then 10 x 4 = 40...that's the Stop. And 11 x 4 + 1 = 45...the Limit)
These variables can be tightened up significantly if I enjoy the speed of automation. I'm betting I won't experience a reverse within that spread range plus my one pip profit. Buy and Sell every currency (the conventional hedge), and just use the above math to make a profit.
Does any of this make sense, and (more importantly) can it be automated? Do you know anyone who could help?
Sparks
Sparks,
Any linear process can be automated with fairly simple coding. So I guess it won't be a problem.
As for my problem... just found the answer: I made an error not taking the lotsize into account while calculating the margin.
Russell
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'm trying to calculate the margin while hedging. In the code below I made an atempt to calculate the correct margin. The function works fine if there are only trades open in one direction. But it's totally off when the EA has trades open in both directions. Any help would be highly appreciated!
thanks!
Russell