Larger profits than expected with "OverAllPips", can't work out why?!?!
Created at 23 Feb 2015, 20:13
Larger profits than expected with "OverAllPips", can't work out why?!?!
23 Feb 2015, 20:13
Hi all,
I'm using the code below in a Robot that involves hedging... It calculates the total profit for all open positions and if that number is greater than (or equal to) my public parameter of 'OverAllPipsTP' the robot closes all open position and takes profit...
However, when my OverAllPipsTP parameter is met, the profits are often much greater than the parameter amount... Why?
EG: Set parameter to close all positions at 2500. Actual gain greater than 20,000
double overallPips = 0; foreach (var position in Positions) { overallPips += position.Pips; } if (overallPips >= OverAllPipsTP) { Print("OVERALL PIP TOTAL = " + overallPips); foreach (var Position in Positions) { Print("Closing All Positions. Num positions: " + Positions.Count); ClosePosition(Position); } } } } }
9718853
07 Mar 2015, 23:06 ( Updated at: 21 Dec 2023, 09:20 )
And now it actually posts a loss!!!
Now the same code is actually closing at a loss!!! How is this possible??
If the code only closes positions when the overall pip count is +2500 how on earth are the results below even possible?
@9718853