Skip to content

ChartPriceScaleMode

enum cAlgo.API Since 5.10

DesktopCLICloud

Represents the price scale mode of the chart main area.

Definition

public enum ChartPriceScaleMode

Namespace: cAlgo.API · Group: Chart

Examples

using cAlgo.API;

namespace cAlgo
{
    // This example shows how to use the Chart ChartPriceScaleMode
    public partial class ChartPriceScaleModeSample : Indicator
    {
        protected override void Initialize()
        {
            Chart.PriceScaleMode = PriceScaleMode;

            Print("Price scale mode: {0} | Base price: {1}", Chart.PriceScaleMode, Chart.PriceScaleBasePrice);

            Chart.PriceScaleChanged += args => Print("Price scale mode changed to: {0}", args.Chart.PriceScaleMode);
        }

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

from cAlgo.API import *

class Test():
    def initialize(self):
        api.Chart.PriceScaleMode = ChartPriceScaleMode.Percent

        print(f"Price scale mode: {api.Chart.PriceScaleMode} | Base price: {api.Chart.PriceScaleBasePrice}")

        api.Chart.PriceScaleChanged += lambda args: print(f"Price scale mode changed to: {args.Chart.PriceScaleMode}")
{
  "AccessRights": "None",
  "TimeZone": "UTC",
  "IsOverlay": true,
  "Parameters": [
    {
      "Name": "PriceScaleMode",
      "DisplayName": "Price Scale Mode",
      "Type": "Enum",
      "EnumTypeFullName": "cAlgo.API.ChartPriceScaleMode",
      "DefaultValue": "Percent"
    }
  ]
}

Values

Name Value Description
Regular 0 The regular linear price scale. The Y axis shows prices.
Percent 1 The percentage price scale. The Y axis shows the percentage change of the price from the base price, which is the close price of the first visible bar. Auto scale is always enabled in this mode.
IndexedTo100 2 The indexed to 100 price scale. The Y axis shows the price as an index where the base price, the close price of the first visible bar, equals 100. Auto scale is always enabled in this mode.
Logarithmic 3 The logarithmic price scale. Equal vertical distances represent equal percentage changes of the price. Zero and negative prices are drawn on a logarithmic scale mirrored below zero.

See also