Skip to content

ChartTemplateDisplaySettings

interface cAlgo.API Since 5.6

DesktopCLICloud

Represents the chart template display Settings.

Environment behaviour

Cloud — not supported. Never available in the cloud: it is only returned by members that do not work there (ChartTemplate.DisplaySettings).

Definition

public interface ChartTemplateDisplaySettings

Namespace: cAlgo.API · Group: Templates

Examples

using cAlgo.API;

namespace cAlgo.Robots;

public partial class ChartTemplate : Robot
{
    protected override void OnStart()
    {
        var template = ChartTemplates.Get("Template Name");

        if (template is null)
        {
            Print("Template not found");
            return;
        }

        template.DisplaySettings.AskPriceLine = true;
        template.DisplaySettings.Bars = true;
        template.DisplaySettings.BidPriceLine = true;
        template.DisplaySettings.ChartScale = true;
        template.DisplaySettings.DealMap = true;
        template.DisplaySettings.Grid = true;
        template.DisplaySettings.IndicatorTitles = true;
        template.DisplaySettings.MarketSentiment = true;
        template.DisplaySettings.Orders = true;
        template.DisplaySettings.PeriodSeparators = true;
        template.DisplaySettings.Positions = true;
        template.DisplaySettings.PriceAlerts = true;
        template.DisplaySettings.PriceAxisOverlayButtons = true;
        template.DisplaySettings.QuickTradeButtons = true;
        template.DisplaySettings.Targets = true;
        template.DisplaySettings.TickVolume = true;
        template.DisplaySettings.AddRobotButton = true;
        template.DisplaySettings.PriceScaleMode = ChartPriceScaleMode.Percent;
        template.DisplaySettings.IsPriceScaleInverted = true;
        template.DisplaySettings.IsPriceToBarRatioLocked = false;
        template.DisplaySettings.IsScalePriceChartOnly = true;
        template.DisplaySettings.PriceAxisPosition = ChartPriceAxisPosition.Left;

        Print("Price to bar ratio: {0}", template.DisplaySettings.PriceToBarRatio);
    }
}
import clr

clr.AddReference("cAlgo.API")

# Import cAlgo API types
from cAlgo.API import *

# Import trading wrapper functions
from robot_wrapper import *

class Test():
    def on_start(self):
        template = api.ChartTemplates.Get("Template Name")

        if template is None:
            print("Template not found")
            return

        template.DisplaySettings.AskPriceLine = True
        template.DisplaySettings.Bars = True
        template.DisplaySettings.BidPriceLine = True
        template.DisplaySettings.ChartScale = True
        template.DisplaySettings.DealMap = True
        template.DisplaySettings.Grid = True
        template.DisplaySettings.IndicatorTitles = True
        template.DisplaySettings.MarketSentiment = True
        template.DisplaySettings.Orders = True
        template.DisplaySettings.PeriodSeparators = True
        template.DisplaySettings.Positions = True
        template.DisplaySettings.PriceAlerts = True
        template.DisplaySettings.PriceAxisOverlayButtons = True
        template.DisplaySettings.QuickTradeButtons = True
        template.DisplaySettings.Targets = True
        template.DisplaySettings.TickVolume = True
        template.DisplaySettings.AddRobotButton = True
        template.DisplaySettings.PriceScaleMode = ChartPriceScaleMode.Percent
        template.DisplaySettings.IsPriceScaleInverted = True
        template.DisplaySettings.IsPriceToBarRatioLocked = False
        template.DisplaySettings.IsScalePriceChartOnly = True
        template.DisplaySettings.PriceAxisPosition = ChartPriceAxisPosition.Left

        print(f"Price to bar ratio: {template.DisplaySettings.PriceToBarRatio}")
{
  "AccessRights": "None",
  "AddIndicators": true
}

Properties

Name Description
AddRobotButtonDesktopCLICloudbool Defines if the Add cBot button is displayed on the chart.
AskPriceLineDesktopCLICloudbool Defines if the Ask Price Line is displayed on the chart.
BarsDesktopCLICloudbool Defines if the Bars is displayed on the chart.
BidPriceLineDesktopCLICloudbool Defines if the Bid Price Line is displayed on the chart.
ChartScaleDesktopCLICloudbool Defines if the Chart Scale is displayed on the chart.
ChartTypeDesktopCLICloudChartType Gets or sets the type of the chart for chart template.
DealMapDesktopCLICloudbool Defines if the Deal Map is displayed on the chart.
GridDesktopCLICloudbool Defines if the Grid is displayed on the chart background.
IndicatorTitlesDesktopCLICloudbool Defines if the Indicator Titles are displayed on the chart.
IsPriceScaleInvertedDesktopCLICloudbool Defines if the price scale is inverted for chart template.
IsPriceToBarRatioLockedDesktopCLICloudbool Defines if the price to bar ratio is locked for chart template. Locking sets the price scale mode to Regular.
IsScalePriceChartOnlyDesktopCLICloudbool Defines if the auto scale fits only the bars for chart template.
MarketSentimentDesktopCLICloudbool Defines if the Market Sentiment is visible on the chart.
OrdersDesktopCLICloudbool Defines if the Orders are displayed on the chart.
PeriodSeparatorsDesktopCLICloudbool Defines if the Period Separators are displayed on the chart.
PositionsDesktopCLICloudbool Defines if the Positions are displayed on the chart.
PriceAlertsDesktopCLICloudbool Defines if the Price Alerts are visible on the chart.
PriceAxisOverlayButtonsDesktopCLICloudbool Defines if the price axis overlays buttons are visible on the chart.
PriceAxisPositionDesktopCLICloudChartPriceAxisPosition Gets or sets the price axis position for chart template.
PriceScaleModeDesktopCLICloudChartPriceScaleMode Gets or sets the price scale mode for chart template. While the template price to bar ratio is locked only Regular can be set, and setting any other mode is ignored.
PriceToBarRatioDesktopCLIClouddouble Gets or sets the price to bar ratio for chart template. Values that are not greater than zero, NaN or infinite are ignored.
QuickTradeButtonsDesktopCLICloudbool Defines if the QuickTrade buttons are visible on the chart.
TargetsDesktopCLICloudbool Defines if the Target is visible on the chart.
TickVolumeDesktopCLICloudbool Defines if the Tick Volume is displayed on the chart.
ZoomLevelDesktopCLICloudint Gets or sets the chart zoom percent value for chart template. Valid values are from 5 to 500 with a step of 5, as can be seen on UI in the charts Zoom control.

See also