Skip to content

ChartTypeEventArgs

class cAlgo.API

DesktopCLICloud

Provides data for the chart type change event.

Environment behaviour

Cloud — not supported. Never raised in the cloud: the events that pass it never fire there (Chart.ChartTypeChanged).

Definition

public class ChartTypeEventArgs

Namespace: cAlgo.API · Group: EventArgs

Examples

using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartTypeEventArgs
    public partial class ChartTypeEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.ChartTypeChanged += Chart_ChartTypeChanged;
        }

        private void Chart_ChartTypeChanged(ChartTypeEventArgs obj)
        {
            var text = string.Format("Chart Type Changed To: {0}", obj.Chart.ChartType);

            Chart.DrawStaticText("type", text, VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);
        }

        public override void Calculate(int index)
        {
        }
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.ChartTypeChanged += self.on_chart_type_changed

    def on_chart_type_changed(self, args):
        api.Chart.DrawStaticText("type", f"Chart Type Changed To: {args.Chart.ChartType}", VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red)
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}

Properties

Name Description
ChartDesktopCLICloudChart Gets the chart.

See also