protected void DrawHorizontalLine(string objectName, double y, Colors color, double thickness = 1.0, cAlgo.API.LineStyle style = cAlgo.API.LineStyle.Solid) { _addedAlgoChartObjects.Add(objectName); _chartObjects.DrawHorizontalLine(objectName, y, color, thickness, style); }
protected void DrawLine(string objectName, DateTime date1, double y1, DateTime date2, double y2, Colors color, double thickness = 1.0, cAlgo.API.LineStyle style = cAlgo.API.LineStyle.Solid) { _addedAlgoChartObjects.Add(objectName); _chartObjects.DrawLine(objectName, date1, y1, date2, y2, color, thickness, style); }
protected void DrawVerticalLine(string objectName, int index, Colors color, double thickness = 1.0, cAlgo.API.LineStyle style = cAlgo.API.LineStyle.Solid) { _addedAlgoChartObjects.Add(objectName); _chartObjects.DrawVerticalLine(objectName, index, color, thickness, style); }
protected double vol_weighted_cnt(cAlgo.API.Collections.IReadonlyList<cAlgo.API.MarketDepthEntry> mkentries) { double weightdiv = 0.0; double tsum = 0.0; for (int i = 0; i < mkentries.Count; i++) { var aent = mkentries[i]; tsum += (double)aent.Volume * (double)aent.Price; weightdiv += (double)aent.Price; } if (weightdiv == 0) { return 0; } else { return tsum / weightdiv; } }