I want to download historical data in 1 or 5-second intervals, but I can't use GetHistoryUnsynched since HistoryScale doesn't enumerate seconds.
Instead, I tried to use
but I couldn't find the method to actually get the data.
Your help is appreciated.
Instead, I tried to use
CODE:
new BarHistory(bars.Symbol, Frequency.Second);
but I couldn't find the method to actually get the data.
Your help is appreciated.
Rename
CODE:
new BarHistory(bars.Symbol, new HistoryScale(Frequency.Second, 1))
Thank you
CODE:
BarHistory secondsBar = GetHistoryUnsynched(bars.Symbol, new HistoryScale(Frequency.Second, 1));
And how to synchronize, say, hourly bars (which is strategy setting) with daily bars (which is generated from `GetHistoryUnsynched`)?
CODE:
public override void Initialize(BarHistory bars) { BarHistory daily = GetHistoryUnsynched("MSFT", HistoryScale.Daily); BarHistory synched = BarHistorySynchronizer.Synchronize(daily, bars); PlotBarHistory(synched, "Synched"); }
Thanks. Worked out.
How to synchronize an indicator? I tried
But how to pack _atrSynced from bars to indicator to plot it?
---
Also, is it possible to get GetHistoryUnsynched with HistoryScale.Daily but starting from 8:00am?
How to synchronize an indicator? I tried
CODE:
var barsDaily = GetHistoryUnsynched(bars.Symbol, HistoryScale.Daily); _atr = ATR.Series(barsDaily, 14); _atrSynced = BarHistorySynchronizer.Synchronize(_atr.Bars, bars);
But how to pack _atrSynced from bars to indicator to plot it?
---
Also, is it possible to get GetHistoryUnsynched with HistoryScale.Daily but starting from 8:00am?
Use TimeSeriesSynchronizer instead of BarHistorySynchronizer.
To get intraday data starting from 8:00? I suppose you could create a new BarHistory instance manually, and loop through the full BarHistory, using the Add method to add bars to the new one including only bars that fall within whatever time filter you're interested in.
To get intraday data starting from 8:00? I suppose you could create a new BarHistory instance manually, and loop through the full BarHistory, using the Add method to add bars to the new one including only bars that fall within whatever time filter you're interested in.
Your Response
Post
Edit Post
Login is required