Skip to content

ChartArea.PriceScaleChanged

event · ChartArea · cAlgo.API Since 5.10

DesktopCLICloud

Occurs when the price scale state of the chart area changes: the auto scale is enabled or disabled, or the price scale is reset. On the main chart area it also occurs when any chart level price scale setting changes: the price scale mode, the inversion, the price to bar ratio lock or value, the scale price chart only option or the price axis position. Not raised in the silent backtesting, the CLI and the cloud.

Definition

event Action<ChartPriceScaleEventArgs> PriceScaleChanged;
chartArea.PriceScaleChanged += handler  # handler(obj: ChartPriceScaleEventArgs)

Examples

Chart.PriceScaleChanged += args => Print("Price scale changed | Auto scale: {0} | Price scale mode: {1}", args.ChartArea.IsAutoScaleEnabled, args.Chart.PriceScaleMode);
api.Chart.PriceScaleChanged += lambda args: print(f"Price scale changed | Auto scale: {args.ChartArea.IsAutoScaleEnabled} | Price scale mode: {args.Chart.PriceScaleMode}")