Page 1 of 1

Apply strategy to historical data

Posted: Tue May 21, 2019 9:21 am
by SuperDriveGuy
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

Re: Apply strategy to historical data

Posted: Wed May 22, 2019 8:12 am
by Andry API support
hi SuperDriveGuy,
Unfortunately no. Applying demo strategies to the historical data is not supported.

Re: Apply strategy to historical data

Posted: Mon May 27, 2019 1:05 pm
by SuperDriveGuy
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!

Re: Apply strategy to historical data

Posted: Tue May 28, 2019 6:11 pm
by Andry API support
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.