Issues IndicoreSDK cf Backtest MarketScope

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Issues IndicoreSDK cf Backtest MarketScope

Postby Loggy48 » Fri Jul 03, 2015 9:01 am

There seems to be a difference in implementation of the helper function ExtSubscribe1 between the Indicore strategy debugger and back testing in marketscope. In fact it may be true for ExtSubscribe too.

My strategy needs ticks, 1 minute bars and 15 minute bars. These are coded in ExtUpdate in that ID order - id=1 for ticks, id=2 for 1 minute bars and id=3 for 15 minute bars. In Prepare:

Code: Select all
   sourceT1 = ExtSubscribe(1, nil, "t1", true, "tick")
   sourceM1      = ExtSubscribe1(2,nil,"m1",1530,true,"bar")
   sourceM15    = ExtSubscribe1(3,nil,"m15",602,true,"bar")


Trading is not started until sufficient histories have been loaded for the bars. I update all the indicators at the beginning within each id section in ExtUpdate, whether sufficient bars have been loaded or not but there is a logical check on the period that stops any trading until all bars have been loaded.

IndicoreSDK both in regular forward testing and in the backtest mode agree with MarketScope in forward mode. At the first minute, all 1530 bars are loaded for id=2 (1 minute) and when the first id=3 (15 minute) call is made, all 602 bars are loaded. I check the size of the history and the period - period is 1 fewer than the data size for bar data but the same for the tick data.

In this table, the three groups are for tick, 1 minute and 15 minute respectively and the four numbers are: id, period, minumum required and size of history:

Code: Select all
Tick data      1 Minute data      15 minute data
1 321 101 321    2 1529 1530 1530    30    602    0 OK false
1 363 101 363    2 1530 1530 1531    3    0    602    0 OK false
1 405 101 405    2 1531 1530 1532    3    0    602    0 OK false
1 454 101 454    2 1532 1530 1533    3    0    602    0 OK false
1 503 101 503    2 1533 1530 1534    3    0    602    0 OK false
1 555 101 555    2 1534 1530 1535    3    0    602    0 OK false
1 598 101 598    2 1535 1530 1536    3    0    602    0 OK false
1 637 101 637    2 1536 1530 1537    3    0    602    0 OK false
1 637 101 637    2 1536 1530 1537    3 601    602 602 OK false
1 683 101 683    2 1537 1530 1538    3 601    602 602 OK false
1 734 101 734    2 1538 1530 1539    3 601    602 602 OK false
1 777 101 777    2 1539 1530 1540    3 601    602 602 OK false
1 819 101 819    2 1540 1530 1541    3 601    602 602 OK false
1 864 101 864    2 1541 1530 1542    3 601    602 602 OK false
1 899 101 899    2 1542 1530 1543    3 601    602 602 OK false
1 939 101 939    2 1543 1530 1544    3 601    602 602 OK false
1 984 101 984    2 1544 1530 1545    3 601    602 602 OK false
1 1028 101 1028  2 1545 1530 1546    3 601    602 602 OK false
1 1065 101 1065  2 1546 1530 1547    3 601    602 602 OK false
1 1106 101 1106  2 1547 1530 1548    3 601    602 602 OK false
1 1151 101 1151  2 1548 1530 1549    3 601    602 602 OK false
1 1194 101 1194  2 1549 1530 1550    3 601    602 602 OK false
1 1232 101 1232  2 1550 1530 1551    3 601    602 602 OK false
1 1279 101 1279  2 1551 1530 1552    3 601    602 602 OK false
1 1279 101 1279  2 1551 1530 1552    3 602    602 603 OK false
1 1323 101 1323  2 1552 1530 1553    3 602    602 603 OK true
1 1357 101 1357  2 1553 1530 1554    3 602    602 603 OK true
1 1387 101 1387  2 1554 1530 1555    3 602    602 603 OK true


This is as it should be, I think. The last column marked OK is just the logical that each of the three sources have exceeded their requirement.

However in backtesting in Marketscope, the result is different - no data appears to be preloaded at all for either the 1 minute or 15 minute data, as the table below shows.

This is rather unfortunate (a) because there appears to be a discepancy until the data is fully loaded, which can take some time, and (b) because backtesting in MarketScope is much faster (10x) than the same in the IndicoreSDK. It may also mean that optimisation or other calculations will give misleading results.

Code: Select all
   Tick data               1 Minute data            15 minute data
1     8 101  8       2    0 1530  1    3 0 602 0 OK false
1    16 101 16       2    1 1530  2    3 0 602 0 OK false
1    24 101 24       2    2 1530  3    3 0 602 0 OK false
1    32 101 32       2    3 1530  4    3 0 602 0 OK false
1    40 101 40       2    4 1530  5    3 0 602 0 OK false
1    48 101 48       2    5 1530  6    3 0 602 0 OK false
1    56 101 56       2    6 1530  7    3 0 602 0 OK false
1    64 101 64       2    7 1530  8    3 0 602 0 OK false
1    72 101 72       2    8 1530  9    3 0 602 0 OK false
1    80 101 80       2    9 1530 10    3 0 602 0 OK false
1    88 101 88       2 10 1530 11    3 0 602 0 OK false
1    96 101 96       2 11 1530 12    3 0 602 0 OK false
1 104 101 104    2 12 1530 13    3 0 602 0 OK false
1 112 101 112    2 13 1530 14    3 0 602 0 OK false
1 120 101 120    2 14 1530 15    3 0 602 0 OK false
1 120 101 120    2 14 1530 15    3 0 602 1 OK false
1 128 101 128    2 15 1530 16    3 0 602 1 OK false
1 136 101 136    2 16 1530 17    3 0 602 1 OK false
1 144 101 144    2 17 1530 18    3 0 602 1 OK false
1 152 101 152    2 18 1530 19    3 0 602 1 OK false
1 160 101 160    2 19 1530 20    3 0 602 1 OK false
1 168 101 168    2 20 1530 21    3 0 602 1 OK false
1 176 101 176    2 21 1530 22    3 0 602 1 OK false
1 184 101 184    2 22 1530 23    3 0 602 1 OK false
1 192 101 192    2 23 1530 24    3 0 602 1 OK false
1 200 101 200    2 24 1530 25    3 0 602 1 OK false
1 208 101 208    2 25 1530 26    3 0 602 1 OK false
1 216 101 216    2 26 1530 27    3 0 602 1 OK false
1 224 101 224    2 27 1530 28    3 0 602 1 OK false
1 232 101 232    2 28 1530 29    3 0 602 1 OK false
1 240 101 240    2 29 1530 30    3 0 602 1 OK false
1 240 101 240    2 29 1530 30    3 1 602 2 OK false
1 248 101 248    2 30 1530 31    3 1 602 2 OK false
1 256 101 256    2 31 1530 32    3 1 602 2 OK false
1 264 101 264    2 32 1530 33    3 1 602 2 OK false
1 272 101 272    2 33 1530 34    3 1 602 2 OK false
1 280 101 280    2 34 1530 35    3 1 602 2 OK false
1 288 101 288    2 35 1530 36    3 1 602 2 OK false
1 296 101 296    2 36 1530 37    3 1 602 2 OK false
1 304 101 304    2 37 1530 38    3 1 602 2 OK false
1 312 101 312    2 38 1530 39    3 1 602 2 OK false
1 320 101 320    2 39 1530 40    3 1 602 2 OK false
1 328 101 328    2 40 1530 41    3 1 602 2 OK false
1 336 101 336    2 41 1530 42    3 1 602 2 OK false
1 344 101 344    2 42 1530 43    3 1 602 2 OK false
1 352 101 352    2 43 1530 44    3 1 602 2 OK false
1 352 101 352    2 43 1530 44    3 2 602 3 OK false
1 360 101 360    2 44 1530 45    3 2 602 3 OK false
1 368 101 368    2 45 1530 46    3 2 602 3 OK false
1 376 101 376    2 46 1530 47    3 2 602 3 OK false


(It goes on for ages like this - taking over 9500 minutes before the OK turns to true.)
Can anyone suggest why this should be so? Are histories just not pre-loaded in MarketScope backtest mode?
Loggy48
 
Posts: 89
Joined: Tue Jun 24, 2014 8:39 am
Location: Manchester, UK

Re: Issues IndicoreSDK cf Backtest MarketScope

Postby Julia CJ » Mon Jul 06, 2015 6:56 am

Are histories just not pre-loaded in MarketScope backtest mode?


Hi Loggy48!

You're right, histories data are not loaded.

Backtester doesn't allow to load any data outside the specified range (this range of data you selected in the Wizard). So when the strategy creates all streams are empty. They build up during backtesting.
Julia CJ
 


Return to Discussions

Who is online

Users browsing this forum: No registered users and 13 guests