Esempio n. 1
0
 public void Start()
 {
     OHLC.Wireup();
     PriceBar.Wireup();
     Candlesticks.Wireup();
     HeikenAshi.Wireup();
     Renko.Wireup();
 }
Esempio n. 2
0
        public void BinanceRenko(string symbol, int nbars = 12)
        {
            var pathname = Path.Combine(Folder.crypto_folder, string.Format("analyzer_output_BINANCE_{0}.txt", symbol));

            OpenCoutFile(pathname);

            var renko = new Renko("BINANCE", symbol, nbars);

            CloseCoutFile();
        }
Esempio n. 3
0
        internal override void Paint(object drawingContext)
        {
            //if (_painted) return;

            Style ps = null;

            if (_priceStyleType != _chartPanel._chartX._priceStyle || _seriesTypeType != _seriesType)
            {
                if (_chartPanel._chartX._priceStyle != PriceStyleEnum.psStandard)
                {
                    switch (_chartPanel._chartX._priceStyle)
                    {
                    case PriceStyleEnum.psKagi:
                        ps = new Kagi(this);
                        break;

                    case PriceStyleEnum.psCandleVolume:
                    case PriceStyleEnum.psEquiVolume:
                    case PriceStyleEnum.psEquiVolumeShadow:
                        ps = new EquiVolume(this);
                        break;

                    case PriceStyleEnum.psPointAndFigure:
                        ps = new PointAndFigure(this);
                        break;

                    case PriceStyleEnum.psRenko:
                        ps = new Renko(this);
                        break;

                    case PriceStyleEnum.psThreeLineBreak:
                        ps = new ThreeLineBreak(this);
                        break;

                    case PriceStyleEnum.psHeikinAshi:
                        ps = new HeikinAshi(this);
                        break;
                    }
                }
                else
                {
                    switch (_seriesType)
                    {
                    case SeriesTypeEnum.stCandleChart:
                        ps = new Candles(this);
                        break;

                    case SeriesTypeEnum.stStockBarChartHLC:
                    case SeriesTypeEnum.stStockBarChart:
                        ps = new PriceStyles.Stock(this);
                        break;

                    case SeriesTypeEnum.stLineChart:
                        ps = new Linear(this);
                        break;
                    }
                }
                if (_priceStyle != null)
                {
                    _priceStyle.RemovePaint();
                }
            }

            if (_darvasBoxes != null)
            {
                _darvasBoxes.RemovePaint();
            }

            if (_chartPanel._chartX._priceStyle == PriceStyleEnum.psStandard || _chartPanel._chartX._priceStyle == PriceStyleEnum.psHeikinAshi)
            {
                if (_darvasBoxes == null)
                {
                    _darvasBoxes = new DarvasBoxes(this);
                }

                _darvasBoxes.SetSeriesStock(this);
                if (_chartPanel._chartX._darwasBoxes)
                {
                    _darvasBoxes.Paint();
                }
            }

            if (_priceStyle != null || ps != null)
            {
                (ps ?? _priceStyle).SetStockSeries(this);
                Style psToPaint = ps ?? _priceStyle;
                bool  res;
                if (psToPaint is Candles && drawingContext != null)
                {
                    res = psToPaint.Paint(drawingContext);
                }
                else
                {
                    res = psToPaint.Paint();
                }
                //if (!(ps ?? _priceStyle).Paint()) return;
                if (!res)
                {
                    return;
                }
            }

            if (Selected)
            {
                ShowSelection();
            }

            if (ps == null)
            {
                return;
            }

            _priceStyle     = ps;
            _priceStyleType = _chartPanel._chartX._priceStyle;
            _seriesTypeType = _seriesType;
        }
Esempio n. 4
0
 public TickerReference Setup(TickerSymbol tickerSymbol, FeedInterval interval, RenkoPriceOption priceBarOption)
 {
     return(Renko.Setup(tickerSymbol, interval, priceBarOption));
 }
Esempio n. 5
0
 public IPriceOptionFeed <RenkoPriceOption, double> Subscribe(TickerReference tickerReference, RenkoPriceOption priceOption, Action <TickerReference, long, RenkoPriceOption, double> priceAction)
 {
     return(Renko.Subscribe(tickerReference, priceOption, priceAction));
 }
Esempio n. 6
0
 public IPriceItemFeed <IRenkoBar> Subscribe(TickerReference tickerReference, Action <TickerReference, IRenkoBar> priceAction)
 {
     return(Renko.Subscribe(tickerReference, priceAction));
 }
        public RenkoChart(ChartView BaseChart)
        {
            AuxChartView   = new ChartView();
            candle         = new Candle();
            renko          = new Renko();
            this.BaseChart = BaseChart;

            candle.FillSampleValues(12);

            BaseChart.Chart.Title.Text = "Renko";

            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Left.Visible         = true;
            BaseChart.Chart.Axes.Bottom.Visible       = true;
            BaseChart.Chart.Series.Add(renko);
            BaseChart.Chart.Series.Add(candle);

            //renko.Clear();
            for (int i = 0; i < candle.Count; i++)
            {
                renko.Add(candle.CloseValues[i]);
            }

            // box size set to 2
            //renko.BoxSize = 5;
            //renko.Pointer.Style = PointerStyles.Rectangle;
            //renko.Title = "Renko (Close values)";

            candle.Title = "Trading Data";

            candle.HorizAxis = HorizontalAxis.Bottom;
            candle.VertAxis  = VerticalAxis.Left;

            BaseChart.Chart.Axes.Left.Title.Visible    = false;
            BaseChart.Chart.Axes.Bottom.Title.Visible  = false;
            BaseChart.Chart.Axes.Bottom.Labels.Visible = true;
            BaseChart.Chart.Axes.Left.Labels.Visible   = true;

            BaseChart.Chart.Axes.Left.AxisPen.Visible = true;
            BaseChart.Chart.Axes.Bottom.Visible       = true;
            BaseChart.Chart.Axes.Bottom.Ticks.Visible = false;
            BaseChart.Chart.Axes.Left.Increment       = 10;

            BaseChart.Chart.Panel.Left = 0;

            BaseChart.Chart.Axes.Bottom.RelativePosition = 53;
            BaseChart.Chart.Axes.Left.EndPosition        = 47;

            customLeftRenko   = CreateAxis();
            customBottomRenko = CreateAxis();
            //Themes.UpdateAxes(customLeftRenko, customBottomRenko);

            //BaseChart.Chart.Axes.Custom.Add(customLeftRenko);
            //BaseChart.Chart.Axes.Custom.Add(customBottomRenko);

            customLeftRenko.Horizontal         = false;
            customLeftRenko.StartPosition      = 53;
            customLeftRenko.EndPosition        = 100;
            customLeftRenko.Grid               = BaseChart.Chart.Axes.Left.Grid;
            customLeftRenko.AxisPen.Visible    = true;
            customLeftRenko.Increment          = 10;
            customLeftRenko.AxisPen.Color      = customLeftRenko.AxisPen.GetColor().AddLuminosity(-0.2);
            customLeftRenko.Ticks.Transparency = 100;

            customBottomRenko.Horizontal       = true;
            customBottomRenko.StartPosition    = 0;
            customBottomRenko.EndPosition      = 100;
            customBottomRenko.RelativePosition = 0;
            customBottomRenko.AxisPen.Visible  = true;
            customBottomRenko.Ticks.Visible    = false;
            customBottomRenko.AxisPen.Color    = customBottomRenko.AxisPen.GetColor().AddLuminosity(-0.2);

            //renko.HorizAxis = HorizontalAxis.Bottom;
            //renko.VertAxis = VerticalAxis.Custom;
            //renko.CustomHorizAxis = customBottomRenko;
            //renko.CustomVertAxis = customLeftRenko;

            BaseChart.Chart.Axes.Bottom.Automatic        = true;
            BaseChart.Chart.Axes.Bottom.AutomaticMaximum = true;
            BaseChart.Chart.Axes.Bottom.AutomaticMinimum = true;
            BaseChart.Chart.Axes.Left.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue);

            customLeftRenko.SetMinMax(BaseChart.Chart.Axes.Left.MinYValue, BaseChart.Chart.Axes.Left.MaxYValue);
            customBottomRenko.Automatic        = true;
            customBottomRenko.AutomaticMaximum = true;
            customBottomRenko.AutomaticMinimum = true;
        }