Hi,

 

I 'm implementing the 24hour volume of a Altcoin/BTC pair.

I want to make a history request and a warm-up feature.

I made a rolling window for 1440 minutes = 24hour to insert the volume data.

  1. private RollingWindow<decimal> _window = new(1440);
  1. var history = History<TradeBar>(symbol, 1440, Resolution.Minute); //1440 minutes in 1 day.
  2. foreach (var bar in history)
  3. {
  4. _window.Add(bar.Volume);
  5. }
  6. // volume is only available in trade bar
  7. if (data.Bars.ContainsKey(symbol))
  8. {
  9. _window.Add(data.Bars[symbol].Volume);
  10. }

Buying part condition:

  1. //BUYING PART!!
  2. if (!invested _window.Sum() > _VolumeMinimum)

 

I'm confused and dont know how to implement a history request and a warm-up featur.

 

Thanks in advance.

 

 

Author

Vronghel

August 2022