Here is the code I think should be pulling the data:
AddDataSeries(Data.BarsPeriodType.Minute, 1); // Add a 1-minute data series
// Calculate 30-day trading volume average
double averageVolume = SUM(Volume, 30)[0] / 30.0;
}
}
protected override void OnBarUpdate()
{
if (CurrentBar < 1)
return;
string symbol = Instrument.MasterInstrument.Name;
double percentageIncrease = (Close[0] - Close[1]) / Close[1] * 100;
if (stockIncreases.ContainsKey(symbol))
{
if (percentageIncrease > stockIncreases[symbol])
stockIncreases[symbol] = percentageIncrease;
}
else
{
stockIncreases.Add(symbol, percentageIncrease);
}
double averageVolume = volumeSMA[0];
double currentVolume = Volume[0];
List<string> topStocks = stockIncreases.OrderByDescending(kv => kv.Value)
.Take(10)
.Select(kv => kv.Key)
.ToList();
foreach (string stock in topStocks)
{
if (!hasPurchasedAllQuarters && Time[0].TimeOfDay < new TimeSpan(9, 50, 0))
{
if (percentageIncrease >= 5.0 && averageVolume >= 500000 && currentVolume >= 125000)
Any help will be appreciated.
Thanks

Comment