Different result between live market and Backtest result.
Different result between live market and Backtest result.
10 Nov 2014, 15:00
dear,
I wrote a code below. result ok on forward but when i try to backtest result are not same. Code is below
double HL = MarketSeries.High[0] - MarketSeries.Low[0]; double MaLow = MA_Low.Result.Last(0); double MaHigh = MA_High.Result.Last(0); Print(MaLow + " " + MaHigh + " " + (MarketSeries.High[0] - MarketSeries.Low[0]) + " " + _Filter);
when i attach bot in chat on forward test Print result show like: high-low = 0.00063 like that "that is OK"
But when backtest test Print result show like: high-low = 7.0000 like that . this is wrong result
is anyone solve my problem please..............
Replies
Capilta
14 Nov 2014, 13:58
RE:
Spotware said:
But when backtest test Print result show like: high-low = 7.0000 like that . this is wrong result
7E-05 means 7 * Math.Pow(10, -5) = 0.00007
I am sorry don't understand. do you mean both are same. then why show different value. Then below code not work on backtest.
double HL = MarketSeries.High[0] - MarketSeries.Low[0]; double MaLow = MA_Low.Result.Last(0); double MaHigh = MA_High.Result.Last(0); if (HL > _Filter) { SingalType = 1; }
Above code "HL>_Filter" never true in backtest. it is work on forward test. But never True in backtest.
@Capilta
Spotware
14 Nov 2014, 17:45
I am sorry don't understand.
The following page maybe useful for you: https://social.msdn.microsoft.com/Forums/vstudio/en-US/00ecb7eb-a4c1-49c6-9822-b397ca58dfba/exponential-notation-help
Apart from that, there is a strange expression in your code:
double HL = MarketSeries.High[0] - MarketSeries.Low[0];
Probably you need to replace it to
double HL = MarketSeries.High.Last(0) - MarketSeries.Low.Last(0);
@Spotware
Spotware
10 Nov 2014, 17:32
7E-05 means 7 * Math.Pow(10, -5) = 0.00007
@Spotware