---
id: "T:cAlgo.API.ChartPriceScaleEventArgs"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartPriceScaleEventArgs/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ChartPriceScaleEventArgs (class)

Provides data for the chart area price scale change event.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public class ChartPriceScaleEventArgs
```

Available since cAlgo.API 5.10.

## Examples

C#:

```csharp
using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartPriceScaleEventArgs
    public partial class ChartPriceScaleEventArgsSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.PriceScaleChanged += Chart_PriceScaleChanged;

            foreach (var indicatorArea in Chart.IndicatorAreas)
            {
                indicatorArea.PriceScaleChanged += Chart_PriceScaleChanged;
            }
        }

        private void Chart_PriceScaleChanged(ChartPriceScaleEventArgs obj)
        {
            Print("Price scale changed | Is main area: {0} | Auto scale: {1} | Mode: {2} | Inverted: {3} | Ratio locked: {4}",
                obj.ChartArea == obj.Chart, obj.ChartArea.IsAutoScaleEnabled, obj.Chart.PriceScaleMode,
                obj.Chart.IsPriceScaleInverted, obj.Chart.IsPriceToBarRatioLocked);
        }

        public override void Calculate(int index)
        {
        }
    }
}
```

Python:

```python
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.PriceScaleChanged += self.on_price_scale_changed

        for indicatorArea in api.Chart.IndicatorAreas:
            indicatorArea.PriceScaleChanged += self.on_price_scale_changed

    def on_price_scale_changed(self, args):
        print(f"Price scale changed | Auto scale: {args.ChartArea.IsAutoScaleEnabled} | Mode: {args.Chart.PriceScaleMode} | Inverted: {args.Chart.IsPriceScaleInverted} | Ratio locked: {args.Chart.IsPriceToBarRatioLocked}")
```

config.json:

```json
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true
}
```

## Properties

- `public Chart Chart {get;}` — Gets the chart. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartPriceScaleEventArgs/Chart/index.md)
- `public ChartArea ChartArea {get;}` — Gets the chart area whose price scale changed. It is the chart itself for the main area. [details](https://help.ctrader.com/ctrader-algo/references/EventArgs/ChartPriceScaleEventArgs/ChartArea/index.md)

