public Function_MoneyFlow() { InitializeComponent(); tChart1.Aspect.View3D = false; Axis axis = new Axis(tChart1.Chart); axis.OtherSide = true; axis.Horizontal = false; axis.StartEndPositionUnits = PositionUnits.Percent; axis.StartPosition = 80; tChart1.Axes.Custom.Add(axis); Axis axis1 = new Axis(tChart1.Chart); axis1.OtherSide = true; axis1.Horizontal = false; axis1.StartEndPositionUnits = PositionUnits.Percent; axis1.StartPosition = 60; axis1.EndPosition = 80; tChart1.Axes.Custom.Add(axis1); tChart1.Axes.Left.EndPosition = 60; Candle candle = new Candle(tChart1.Chart); Volume volume = new Volume(tChart1.Chart); Line line = new Line(tChart1.Chart); MoneyFlowFunction func = new MoneyFlowFunction(tChart1.Chart); candle.FillSampleValues(100); volume.FillSampleValues(100); line.DataSource = candle; line.CustomVertAxis = axis; volume.CustomVertAxis = axis1; func.Series = line; func.Volume = volume; func.CMFStyle = CMFStyle.Histogram; }
public MoneyFlowProFunctionChart(ChartView BaseChart) { candle = new Candle(); volume = new Volume(); line = new Line(); moneyFlowFunction = new MoneyFlowFunction(); var = new Variables.Variables(); rightAxis = new Axis(); BaseChart.Chart.Header.Text = "Money Flow Index"; BaseChart.Chart.Series.Add(candle); BaseChart.Chart.Series.Add(volume); BaseChart.Chart.Series.Add(line); Themes.CandleGodStyle(candle); Themes.CustomAxisRight(rightAxis); Themes.UpdateAxes(BaseChart.Chart.Axes.Left, BaseChart.Chart.Axes.Bottom); Themes.DoubleAxisChart(BaseChart); BaseChart.Chart.Axes.Custom.Add(rightAxis); BaseChart.Chart.Axes.Left.Automatic = true; BaseChart.Chart.Axes.Left.Ticks.Transparency = 100; BaseChart.Chart.Axes.Bottom.Automatic = true; rightAxis.Automatic = true; candle.FillSampleValues(15); candle.Title = "Candle"; candle.HorizAxis = HorizontalAxis.Bottom; candle.VertAxis = VerticalAxis.Left; volume.HorizAxis = HorizontalAxis.Bottom; volume.VertAxis = VerticalAxis.Custom; volume.CustomVertAxis = rightAxis; volume.XValues.DataMember = "X"; volume.XValues.Order = ValueListOrder.Ascending; volume.YValues.DataMember = "Y"; volume.Title = "Volume"; volume.FillSampleValues(20); volume.LinePen.Width = 3; line.HorizAxis = HorizontalAxis.Bottom; line.VertAxis = VerticalAxis.Custom; line.CustomVertAxis = rightAxis; line.DataSource = candle; line.Function = moneyFlowFunction; line.LinePen.Width = 3; line.Color = var.GetPaletteBasic[2]; line.Title = "Line"; moneyFlowFunction.Series = candle; moneyFlowFunction.Volume = volume; moneyFlowFunction.CMFStyle = CMFStyle.Histogram; moneyFlowFunction.Volume.Color = var.GetPaletteBasic[3]; BaseChart.Chart.Axes.Custom.Add(rightAxis); rightAxis.Automatic = true; BaseChart.Chart.Axes.Left.Automatic = true; BaseChart.Chart.Axes.Bottom.Automatic = true; }