- ago
In my C# coded historical data provider, I set UsesPersistentStorage and SupportsPartialBar properties to true.

When I run WL in the middle of a trading day, I expect it to fetch the current day's partial bar from my provider. However, it only shows bars till the previous traded day.

When I do "Reload chart data from provider", WL then fetches the data from the provider and shows current day's partial bar correctly.
0
334
Solved
7 Replies

Reply

Bookmark

Sort
- ago
#1
Historical providers must delete the partial bar from their data, if returned by data feed. You shouldn't be saving it during the day.
0
- ago
#2
I understand. The partial bar shouldn't be saved because it can change. However, it can be shown in the chart.

When WL needs to show the chart, it can fetch the data from the disk for the completed bars. In addition, since the provider supports partial bars, it can query the provider on the fly for the current day to fetch and show the partial bar - without the user invoking the "Reload" action immediately (after opening the chart). The Reload from the provider option can be used to refresh the data some time after opening the chart to refresh the view.

Otherwise, what is the use of PartialBar Support?
0
- ago
#3
The use of PartialBar support is to return the partial bar using GetPartialBarInternal when the market is open:

https://www.wealth-lab.com/Support/ExtensionApi/HistoricalDataProvider
0
- ago
#4
I know. I am trying to say that the "GetPartialBarInternal" method on my provider is never called during the trading hours if my provider uses persistence and when the UI is on Daily chart - Unless I invoke "Reload data from the provider" option on the chart.
0
Glitch8
 ( 12.10% )
- ago
#5
By convention, WL8 never displays a partial bar unless the chart is streaming. WL8 is primarily a backtesting tool so the partial bar isn't required when backtesting or viewing backtest results on the chart.
0
- ago
#6
I see. Then Reload shouldn't display the partial bar either while in non-streaming mode for the same reason you stated.
0
Glitch8
 ( 12.10% )
- ago
#7
Right, your provider should discard any partial bar. You can call the method RemovePartialBar in your provider before you return the BarHistory. It uses the assigned MarketDetails (Markert property of the BarHistory) to determine if the last bar of data is a partial bar, and removes it accordingly. Let me know if this helps!
1
Best Answer

Reply

Bookmark

Sort