How to get BarScale and BarInterval data on StreamingProviders
Author: yzolotarev
Creation Date: 10/17/2016 6:30 PM
profile picture

yzolotarev

#1
I have the following problem in my Streaming provider.

The way it works fine:

I select the desired timeframe of a desired symbol and press "stream", WL goes into Subscribe method of the StreamingProvider and I get my partial bar from my server, execute UpdatePartialBar and after that subscribe to ticks with UpdateQuoate executing every second. That works fine and I get the current bar OHLC values just fine together with the rest of the bars ahead.

Where the problem begins

Because WL goes into RequestBarData (StaticProvider) right after it goes into Subscribe (Streaming Provider) I will probably be able to catch the BarScale and BarInterval Data from there in order to at first request a correct partial bar from my server (with the right BarScale and BarInterval parameters) and only after that subscribe to ticks for them to form a correct current bar together (minibar + ticks) but what if I change my timeframe with "stream" pressed already and streaming provider running. Where can I get the BarScale and BarInterval data at that point?

I hope I made sense and will be real gratefull for any ideas on this matter. Thank you.
profile picture

Eugene

#2
I don't think you'd be able to obtain the BarScale/BarInterval from within a streaming provider. But to make it simple, call UpdateMiniBar if your provider returns the partial Daily bar (i.e. works on Daily scale and up). Otherwise just use UpdateQuote to deliver the ticks when your provider is capable of streaming both intraday and daily data.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).