Historical listener with layer1 API

Custom indicators, trading strategies, data export and recording and more...
zcsoka
Posts: 290
Joined: Thu Dec 19, 2019 7:50 pm
Has thanked: 2 times
Been thanked: 28 times

Historical listener with layer1 API

Post by zcsoka » Tue Apr 06, 2021 8:03 am

Greetings,

I am implementing a layer1 version2 API based indicator (no simplified) and I did not find a way to apply it to historical data. Although you have posted multiple examples of mixing the simplified and the low level API, it seems not to work in my code. Even if I implement the HistoricalDataListener, the plugin will not be calculated on the historical data (I mean the data since the start of Bookmap, not talking about the cloud data). Am I doing something wrong? Is there an example of historical indicators for  the non simplified interface? 

Many thanks in advance,

Kind Regards,

Zoltan

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

Re: Historical listener with layer1 API

Post by Svyatoslav » Tue Apr 06, 2021 8:36 am

Hi. Since you are using core L1 API, please clarify how are you accessing the history, since there are few ways of doing that. If you are using "Generators extension" (which is what simplified "HistoricalDataListener" uses under the hood) you just need to make sure that you set "shouldReceiveHistory" and "shouldReceiveBackfilledData" flags inside Layer1ApiUserMessageAddStrategyUpdateGenerator

rlojykishf
Posts: 3
Joined: Sat Oct 29, 2022 9:45 am

Re: Historical listener with layer1 API

Post by rlojykishf » Wed Nov 02, 2022 5:20 pm

Hi, how can I use historical data loaded from cloud (Rithmic)? Now I can use only data since start of Bookmap and for SMA 144 (M1) I must wait 144 minutes to get correct MA on chart :(.

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

Re: Historical listener with layer1 API

Post by Andry API support » Mon Nov 07, 2022 1:36 pm

For Simplified API your module needs to implement the BackfilledDataListener interface. As soon as cloud data is loaded your module will be reloaded automatically. For Core API you need to wait for the message indicating the historical data is loaded and then recompute your generators.

Post Reply