public static void TestGraph(this AbstractIndicator ind, string filename, int length) { Quantum q = Quantum.ExcelToQuantum(filename, "symbol", 0); var dz = new DenseMatrix(4 + 1 + ind.SubIndicatorSize, q.Data.Count); List <string> names = new List <string>(); names.Add("symbol"); names.Add(ind.ToString()); foreach (var indicator in ind.SubIndicators) { names.Add(indicator.Key); } //chartoptions ChartOption[] chartOptions = new ChartOption[names.Count]; chartOptions[0] = new ChartOption() { Height = 400, YPosition = 0 }; chartOptions[1] = new ChartOption() { Height = 200, YPosition = 1 }; for (int i = 2; i < chartOptions.Length; i++) { chartOptions[i] = new ChartOption() { Height = 0, YPosition = 1, Layover = true } } ; int counter = 0; foreach (Tick tick in q) { dz[0, counter] = tick.BidOpen; dz[1, counter] = tick.BidHigh; dz[2, counter] = tick.BidLow; dz[3, counter] = tick.BidClose; dz[4, counter] = ind.HandleNextTick(tick); int icounter = 5; foreach (var subind in ind.SubIndicators.Values) { dz[icounter, counter] = subind[0]; icounter++; } counter++; } Visualize.GenerateMultiPaneGraph(names.ToArray(), q.Data.Keys.ToArray(), dz, QSConstants.DEFAULT_DATA_FILEPATH + @"results.html", chartOptions); Console.WriteLine("Done Generating Graph for " + ind.ToString()); }
public DWT(int n, int detailLevel, AbstractIndicator indicator = null) : base(n) { priceData = new MovingQueue <double>(n); st = new SignalTransform(); this.detailLevel = detailLevel; this.indicator = indicator; }
public PercentileRank(int n, AbstractIndicator indicator = null) : base(n) { data = new MovingQueue <double>(n); if (indicator != null) { this.indicator = indicator; } }
public TEMA(int n, AbstractIndicator indicator = null) : base(n) { EMA1 = new EMA(n); EMA2 = new EMA(n); EMA3 = new EMA(n); this.indicator = indicator; }
public Job_SymbolSet(string[] symbols, string timeframe, int numTicks, AbstractIndicator indicator) { this.symbols = symbols; this.indicator = indicator; this.timeframe = timeframe; this.numTicks = numTicks; mktData = new List <MarketDataEventArg>(); graphData = new DenseMatrix(symbols.Length, numTicks); }
public AdaptiveSmoothing(int n, double v = 0.7, int t = 3, AbstractIndicator indicator = null) : base(n) { this.indicator = indicator; GDS = new GDEMA[t]; for (int i = 0; i < t; i++) { GDS[i] = new GDEMA(n, v, indicator); } }
public QSPolyMA(int N, AbstractIndicator indicator = null) : base(N) { tickdata = new MovingQueue <double>(N); this.indicator = indicator; X = new double[N]; for (int i = 0; i < X.Count(); i++) { X[i] = i; } }
public RSquared(int n, AbstractIndicator indicator = null) : base(n) { X = new MovingQueue <double>(n); Y = new DenseVector(n); int counter = 0; for (double i = (double)-Y.Count / 2 + 0.5; i < (double)Y.Count / 2; i++) { Y[counter++] = i; } this.indicator = indicator; }
public Divergence(AbstractIndicator indicator) : base(indicator.Period) { MA = new QSPolyMA(indicator.Period); this.indicator = indicator; subIndicators.Add(indicator.toString(), indicator); }
public GDEMA(int n, double v = 1, AbstractIndicator indicator = null) : base(n) { EMA1 = new EMA(n); EMA2 = new EMA(n); this.indicator = indicator; }
public static void TestGraphLive(this AbstractIndicator ind, string timeframe, string symbol, int length) { //------------grab data FXSession session = new FXSession(); session.InitializeSession(); HistoricPriceEngine h = new HistoricPriceEngine(session); h.GetLongHistoricPrices(symbol, timeframe, length); while (!h.Complete) { Thread.Sleep(100); } //----------------------- Quantum q = h.Data; var dz = new DenseMatrix(4 + 1 + ind.SubIndicatorSize, q.Data.Count); List <string> names = new List <string>(); names.Add("symbol"); names.Add(ind.ToString()); foreach (var indicator in ind.SubIndicators) { names.Add(indicator.Key); } //chartoptions ChartOption[] chartOptions = new ChartOption[names.Count]; chartOptions[0] = new ChartOption() { Height = 400, YPosition = 0 }; chartOptions[1] = new ChartOption() { Height = 200, YPosition = 1 }; for (int i = 2; i < chartOptions.Length; i++) { chartOptions[i] = new ChartOption() { Height = 0, YPosition = 1, Layover = true } } ; int counter = 0; foreach (Tick tick in q) { dz[0, counter] = tick.BidOpen; dz[1, counter] = tick.BidHigh; dz[2, counter] = tick.BidLow; dz[3, counter] = tick.BidClose; dz[4, counter] = ind.HandleNextTick(tick); int icounter = 5; foreach (var subind in ind.SubIndicators.Values) { dz[icounter, counter] = subind[0]; icounter++; } counter++; } Visualize.GenerateMultiPaneGraph(names.ToArray(), q.Data.Keys.ToArray(), dz, QSConstants.DEFAULT_DATA_FILEPATH + @"results.html", chartOptions); Console.WriteLine("Done Generating Graph for " + ind.ToString()); }
public KAMA(int n, AbstractIndicator indicator = null) : base(n) { priceData = new MovingQueue <double>(n); this.indicator = indicator; }
public SMA(int N, AbstractIndicator indicator = null) : base(N) { tickdata = new MovingQueue <double>(N); this.indicator = indicator; }
public EMA(int N, AbstractIndicator indicator = null) : base(N) { alpha = 2.0 / (N + 1); tickdata = new MovingQueue <double>(N); this.indicator = indicator; }
protected void AttachIndicator(string indicatorName, AbstractIndicator i) { indicatorList.Add(indicatorName, i); }
public ZLEMA(int n, AbstractIndicator indicator = null) : base(n) { EMA = new EMA(n); this.indicator = indicator; priceData = new MovingQueue <double>((n - 1) / 2); }
public ROC(int n, AbstractIndicator indicator = null) : base(n) { tickData = new MovingQueue <double>(n); this.indicator = indicator; }