我无法弄清楚为什么我不断收到此错误。请帮忙!!!
“System.Collections.Generic.List”不包含“Where”的定义,并且找不到接受“System.Collections.Generic.List”类型的第一个参数的扩展方法“Where”(您是否缺少 using 指令还是汇编参考?)
using System.Collections.Generic;
using System.Collections;
public class HistTradePlot : Indicator
{
private class Traid
{
public DateTime Date { get; set; }
public int Index { get; set; }
public int Buy { get; set; }
public int Price {get;set;}
}
List<Traid> traids = new List<Traid>();
if (Bars.FirstBarOfSession)
{Bars.Session.GetNextBeginEnd(BarsArray[0], 0,
out sessionBegin, out sessionEnd);
var sessionTrades = traids.Where(t => t.Date > sessionBegin && t.Date <= sessionEnd);
Print("Session Start: " + sessionBegin + " Session End: " + sessionEnd);
for (int i=0;i<sessionTrades.Length();i++){
Print(Convert.ToString(sessionTrades[i].Date));
}
}