ChartPriceScaleEventArgs
class cAlgo.API Since 5.10
DesktopCLICloud
Provides data for the chart area price scale change event.
Definition
public class ChartPriceScaleEventArgs
Namespace: cAlgo.API · Group: EventArgs
Examples
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)
{
}
}
}
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}")
{
"AccessRights": "None",
"TimeZone": "UTC",
"IsOverlay": true
}
Properties
| Name | Description |
|---|---|
ChartDesktopCLICloudChart | Gets the chart. |
ChartAreaDesktopCLICloudChartArea | Gets the chart area whose price scale changed. It is the chart itself for the main area. |