using MarketData.MarketDataModel; using MarketData.Numerical; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // Richard Donchian Channel Breakout. Donchian used 20 days. namespace MarketData.Generator.Indicators { public class ChannelBreakoutIndicator { private ChannelBreakoutIndicator() { } public static bool IsChannelBreakOut(DateTime tradeDate,Prices prices,int dayCount) { if(null==prices||prices.Count !(x.Date.Date.Equals(currentPrice.Date.Date))).ToList()); // make sure currentPrice is not in the list of prices int count=prices.Count(x => x.Close>=currentPrice.Close); // count how many closing prices are above or equal to our closing price return 0==count?true:false; // if no records then currentPrice is the max over the period so return true, otherwise return false; } } }