Apply strategy to historical data

Custom indicators, trading strategies, data export and recording and more...
SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Apply strategy to historical data

Post by SuperDriveGuy » Tue May 21, 2019 9:21 am

Hi,
   I am trying to use some of the demo strategies e.g liquidity tracker. These work fine, but they only start from the point I apply them to the chart, but I see that the strategies you all have posted e.g. advanced cvd, these get applied to historical data too.

 Is there a code snippet that I can add that will make the indicator be applied to historical data too?

Thanks

Tags:

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Apply strategy to historical data

Post by Andry API support » Wed May 22, 2019 8:12 am

hi SuperDriveGuy,
Unfortunately no. Applying demo strategies to the historical data is not supported.

SuperDriveGuy
Posts: 67
Joined: Thu Nov 01, 2018 1:50 pm
Has thanked: 38 times
Been thanked: 9 times

Re: Apply strategy to historical data

Post by SuperDriveGuy » Mon May 27, 2019 1:05 pm

Hi AndreyR,
  I actually worked it out from your reply to my VWAP study thread and VOILA! I now have the indicator applied to the already loaded data
https://www.bookmap.com/forum/viewtopic.php?f=3&t=243

  I just needed to add..
import velox.api.layer1.simplified.HistoricalDataListener

and add ..
implements HistoricalDataListener

Thanks!

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: Apply strategy to historical data

Post by Andry API support » Tue May 28, 2019 6:11 pm

Hi SuperDriveGuy,
There was a kind of misconception (not critical though) on my side.
There are actually two kinds of data that should be distinguished and both of them are historical.
First is what I think of as "historical data". That is data loaded into Bookmap which contains events before the moment Bookmap has been launched. It is not accessible by  custom indicators.
The second is "recent historical data" from the moment Bookmap was launched until the moment the indicator has been launched.
Your indicator can access it if it implements a HistoricalDataListener/HistoricalModeAdapter.

Post Reply