Back testing glitch
Back testing glitch
14 Aug 2016, 04:49
I started to back test a cBot but there are points where it generates 100 or more trades on one single bar. So, my profits appear to go through the roof. Whats happening? It appear to happen with a small 10 pip take profit, increasing the TP to 20 eliminates the effect.
Replies
... Deleted by UFO ...
lec0456
14 Aug 2016, 20:10
RE:
croucrou said:
I don't know, but isn't this related to the question I have asked here:
I looked at your thread but not sure if its the same thing.
At first this looks like an asynchronous verses synchronous issue. but the trades stop after a period of time. It occurs on specific days like 7/9/15 and others.
@lec0456
... Deleted by UFO ...
... Deleted by UFO ...
lec0456
14 Aug 2016, 23:41
Ah!!!!! Thank you very much for that explanation. I will do some testing and see if that's what's happening in my case. I bet it is.
So, I would just program the robot to not trade with a negative spread during back testing, so i get more realistic results but leave it in during live trading just in case I get lucky.
@lec0456
... Deleted by UFO ...
lec0456
15 Aug 2016, 02:49
I would have never in a million years thought the platform backtesting engine would be producing negative spreads as large as 10 pips, but yes you were correct.
I just threw these lines of code in to stop the behavior while backtesting.
if(!Account.IsLive && Symbol.Spread/Symbol.PipSize<=-10) { //Print(MarketSeries.OpenTime[MarketSeries.Close.Count - 1].ToString("MM/dd/yyyy HH:mm")+" Neg Spread: "+Math.Round(Symbol.Spread/Symbol.PipSize,2)); return; }
@lec0456
lec0456
15 Aug 2016, 06:25
RE:
lec0456 said:
I would have never in a million years thought the platform backtesting engine would be producing negative spreads as large as 10 pips, but yes you were correct.
I just threw these lines of code in to stop the behavior while backtesting.
if(!Account.IsLive && Symbol.Spread/Symbol.PipSize<=-10) { //Print(MarketSeries.OpenTime[MarketSeries.Close.Count - 1].ToString("MM/dd/yyyy HH:mm")+" Neg Spread: "+Math.Round(Symbol.Spread/Symbol.PipSize,2)); return; }
Correction !Account.IsLive should be IsBacktesting.
@lec0456
... Deleted by UFO ...
... Deleted by UFO ...