Using HistoricalDataModeListener

Custom indicators, trading strategies, data export and recording and more...
rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Using HistoricalDataModeListener

Post by rickbarlow » Fri Feb 19, 2021 11:49 pm

I am using the HistoricalDataModeListener in a Layer1SimpleAttachable Indicator, bookmap version 7.1

Via tracing logs, I can see that, when I load my indicator, it processes all of the loaded history because I see trace statements in my logs indicating the timeperiods / events that happened. However, the plotting of the indicator lines do not go back into the history section. It seems to start at a place "close to" when this instance bookmap was started. I see that the off-the-shelf CVD indicator plots for all of the history, when you enable it. How can I get the same behavior using my indicator?
 

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

Re: Using HistoricalDataModeListener

Post by Andry API support » Sat Feb 20, 2021 7:22 am

Instead of HistoricalDataListener implement BackfilledDataListener (it extends HistoricalDataListener) so your indicator can plot over cloud historical data.

rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Re: Using HistoricalDataModeListener

Post by rickbarlow » Mon Feb 22, 2021 10:28 pm

Is BackfilledDataListener available in 7.1? I am not able to find an import statement in simplified that supports it.
 

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

Re: Using HistoricalDataModeListener

Post by Andry API support » Tue Feb 23, 2021 7:02 am

Simplified API library must be outdated. The latest version is 7.1.0.65 so the dependency in your build.gradle should look like this

Code: Select all

    compileOnly group: 'com.bookmap.api', name: 'api-simplified', version: '7.1.0.65'
If this is the case rebuild your project.

rickbarlow
Posts: 43
Joined: Mon Feb 08, 2021 5:37 pm
Been thanked: 1 time

Re: Using HistoricalDataModeListener

Post by rickbarlow » Tue Feb 23, 2021 7:15 pm

Can I please verify? My current api-simplified version looks to be larger than the one you provided.
I already have
 
 

Code: Select all

    compileOnly group: 'com.bookmap.api', name: 'api-simplified', version: '7.1.1.1daaafa6e0'

Svyatoslav
Site Admin
Posts: 278
Joined: Mon Jun 11, 2018 11:44 am
Has thanked: 2 times
Been thanked: 31 times

Re: Using HistoricalDataModeListener

Post by Svyatoslav » Tue Feb 23, 2021 7:42 pm

It's not larger, it's a development snapshot. x.x.1.x builds are development builds, those can't be directly compared to release ones (x.x.0.x)

Also make sure to switch repository from http://maven.bookmap.com/maven2/develop/ to http://maven.bookmap.com/maven2/releases/ to use release branch.

Post Reply