- ago
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
CODE:
new BarHistory(bars.Symbol, Frequency.Second);

but I couldn't find the method to actually get the data.

Your help is appreciated.
0
659
Solved
7 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.10% )
- ago
#1
CODE:
new BarHistory(bars.Symbol, new HistoryScale(Frequency.Second, 1))
0
Best Answer
- ago
#2
Thank you
0
- ago
#3
CODE:
BarHistory secondsBar = GetHistoryUnsynched(bars.Symbol, new HistoryScale(Frequency.Second, 1));
0
- ago
#4
And how to synchronize, say, hourly bars (which is strategy setting) with daily bars (which is generated from `GetHistoryUnsynched`)?
0
Glitch8
 ( 12.10% )
- ago
#5
CODE:
public override void Initialize(BarHistory bars) {          BarHistory daily = GetHistoryUnsynched("MSFT", HistoryScale.Daily);          BarHistory synched = BarHistorySynchronizer.Synchronize(daily, bars);          PlotBarHistory(synched, "Synched"); }
1
- ago
#6
Thanks. Worked out.

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?
0
Glitch8
 ( 12.10% )
- ago
#7
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.
0

Reply

Bookmark

Sort