Skip to content

ChartContainer

interface cAlgo.API

DesktopCLICloud

Represents a chart frames container.

Environment behaviour

CLI — not supported. Available to plugins only, and plugins cannot run in the CLI.

Cloud — not supported. Available to plugins only, and plugins cannot run in the cloud.

Definition

public interface ChartContainer

Namespace: cAlgo.API · Group: Chart

Examples

using cAlgo.API;
using System.Linq;

namespace cAlgo.Plugins;

public partial class Test : Plugin
{
    protected override void OnStart()
    {
        // Adding new chart frame to main chart container
        var chartFrame = ChartManager.AddChartFrame(Symbols.First(), TimeFrame.Daily);

        // Detaching chart frame from main container to
        // create a new detached chart container
        chartFrame.Detach();

        // Getting detached chart container
        var detachedChartContainer = chartFrame.ChartContainer;

        // Setting container window width and height
        detachedChartContainer.DetachedWindow.Width = 500;
        detachedChartContainer.DetachedWindow.Height = 300;

        // Adding another chart frame to detached container
        ChartManager.AddChartFrame(Symbols.Last(), TimeFrame.Hour, detachedChartContainer);
    }
}
import clr
clr.AddReference("cAlgo.API")

from cAlgo.API import *

class Test():
    def on_start(self):
        # Adding new chart frame to main chart container
        chartFrame = api.ChartManager.AddChartFrame(api.Symbols[0], TimeFrame.Daily)

        # Detaching chart frame from main container to
        # create a new detached chart container
        chartFrame.Detach()

        # Getting detached chart container
        detachedChartContainer = chartFrame.ChartContainer

        # Setting container window width and height
        detachedChartContainer.DetachedWindow.Width = 500
        detachedChartContainer.DetachedWindow.Height = 300

        # Adding another chart frame to detached container
        api.ChartManager.AddChartFrame(api.Symbols[1], TimeFrame.Hour, detachedChartContainer)
{
  "AccessRights": "None"
}

Methods

Name Description
CloseDesktopCLICloudbool Closes current chart container window.

Properties

Name Description
CountDesktopCLICloudint Returns number of frames existing in chart container.
DetachedWindowDesktopCLICloudDetachedWindow Returns detached window properties of chart container.
IdDesktopCLICloudstring Returns container Id.
ItemDesktopCLICloudFrame Returns a frame by it is index inside chart container.
ModeDesktopCLICloudChartMode Get / set chart mode of chart container.
SelectedFrameDesktopCLICloudFrame Gets or sets the selected frame in the chart container.

See also