Difference between 2 backtest on the same chart/signal

Questions about MultiCharts and user contributed studies.
StratMan
Posts: 173
Joined: 13 Dec 2009
Has thanked: 22 times
Been thanked: 13 times

Difference between 2 backtest on the same chart/signal

Postby StratMan » 29 Jul 2013

How to explain that 2 identical charts with 2 identical signal (Copy/paste of the first one) generate a small difference due to a different result on several trades.

All the trades are identical except one or two.

The difference is on the calculation of the sizing position.
In one case, the result is for example 261 and in the second case it is 260.

The formula to calculate the sizing is :

Sizing = round(value2*MaxRisk/value1,0)

So, is there something special to do with the Round function ?

The signal is applied on a single data series.
Data are identical, allowing also to note that all trades are identical with the same dates, same entry price and same exit price.

The difference is always a single unit, a bit like the Round function became random in certain situations ...

Have you ever encountered this problem and what solutions do you recommend me?

Thank you in advance,
Attachments
130729_MC_deltaBT_round-function.JPG
(507.68 KiB) Downloaded 487 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Difference between 2 backtest on the same chart/signal

Postby TJ » 29 Jul 2013

How to explain that 2 identical charts with 2 identical signal (Copy/paste of the first one) generate a small difference due to a different result on several trades.

All the trades are identical except one or two.

The difference is on the calculation of the sizing position.
In one case, the result is for example 261 and in the second case it is 260.

The formula to calculate the sizing is :

Sizing = round(value2*MaxRisk/value1,0)

So, is there something special to do with the Round function ?

The signal is applied on a single data series.
Data are identical, allowing also to note that all trades are identical with the same dates, same entry price and same exit price.

The difference is always a single unit, a bit like the Round function became random in certain situations ...

Have you ever encountered this problem and what solutions do you recommend me?

Thank you in advance,
What do you mean by "Data are identical"?
What do you mean by "(Copy/paste of the first one)? Copy what? From where to where? On the same computer? Same MultiCharts instance?

Are you doing the same backtest with the same computer?
or do you mean the symbol is the same, but tested on a different computer?

StratMan
Posts: 173
Joined: 13 Dec 2009
Has thanked: 22 times
Been thanked: 13 times

Re: Difference between 2 backtest on the same chart/signal

Postby StratMan » 29 Jul 2013

Thank you TJ for your reply,
What do you mean by "Data are identical"?
What do you mean by "(Copy/paste of the first one)? Copy what? From where to where? On the same computer? Same MultiCharts instance?

Are you doing the same backtest with the same computer?
or do you mean the symbol is the same, but tested on a different computer?
Data are identical : I checked that after Copy/Paste, all the datas were identical, that mean the same first bar, the same OHLC on both sides

I create a first chart and then make a Copy/Paste of this chart in order to clone this chart/signal/settings. I use File/Copy Window (Ctrl + Shift + C)

The copy is done on the same MultiCharts instance, on the same workspace, on the same computer.

Consequently, the backtest is performed on both chart with the same computer, the same signal, the same #1 bar, the same settings and gives the same trades entry/exit.

See the screenshot : this is a copy of the screen (only one computer) without any editing or image manipulation...

Is it more clear now ?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Difference between 2 backtest on the same chart/signal

Postby TJ » 29 Jul 2013

You can use print to find out the value of your variables that feeds sizing.
If the values are the same, then round must be doing something different.

StratMan
Posts: 173
Joined: 13 Dec 2009
Has thanked: 22 times
Been thanked: 13 times

Re: Difference between 2 backtest on the same chart/signal

Postby StratMan » 29 Jul 2013

Thank you, it is precisely from the print I found that my variables were the same as the result is different ... And that's what made ​​me think that the problem may be coming from the Round function ...
Attachments
130729_MC_Round_calculation_Issue_.jpg
(468.73 KiB) Downloaded 506 times

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Difference between 2 backtest on the same chart/signal

Postby TJ » 29 Jul 2013

Thank you, it is precisely from the print I found that my variables were the same as the result is different ... And that's what made ​​me think that the problem may be coming from the Round function ...
try the printout with 4 decimal points and see if there is a hidden gremlin.
(decimals...that's what rounding is about).

StratMan
Posts: 173
Joined: 13 Dec 2009
Has thanked: 22 times
Been thanked: 13 times

Re: Difference between 2 backtest on the same chart/signal

Postby StratMan » 29 Jul 2013

try the printout with 4 decimal points and see if there is a hidden gremlin.
(decimals...that's what rounding is about).
With 4 decimal points, the two printout files have become absolutely identical, but the Strategy Performance Report always shows the same differences ...

So to summarize, the Round function returns a result with random precision of plus or minus 1 unit.

BUT, the printout with 4 decimal points shows exactly the same results, with 4 decimals perfectly identical for both cases.

How is this possible?
How to remove this bug?


Return to “MultiCharts”