Skip to content

ChartArea

interface cAlgo.API

DesktopCLICloud

The Chart Area Interface.

Definition

public interface ChartArea

Namespace: cAlgo.API · Group: Chart

Examples

ChartArea area = Chart.IndicatorAreas.Count > 0 ? Chart.IndicatorAreas[0] : Chart;
area.DrawHorizontalLine("middle", area.BottomY + (area.TopY - area.BottomY) / 2, Color.Gray);
Print("Area size: {0}x{1} | Objects: {2}", area.Width, area.Height, area.Objects.Count);
area = api.Chart.IndicatorAreas[0] if api.Chart.IndicatorAreas.Count > 0 else api.Chart
area.DrawHorizontalLine("middle", area.BottomY + (area.TopY - area.BottomY) / 2, Color.Gray)
api.Print(f"Area size: {area.Width}x{area.Height} | Objects: {area.Objects.Count}")

Methods

Name Description
AddControl 6 overloadsDesktopCLICloudvoid Adds a chart control from the Control Base to the main chart area or to the indicator area.
BarIndexToXDesktopCLIClouddouble Converts Bar Index to X coordinate.
DrawAndrewsPitchfork 6 overloadsDesktopCLICloudChartAndrewsPitchfork Draws an Andrew's pitchfork.
DrawArrow 6 overloadsDesktopCLICloudChartArrow Draws an arrow.
DrawElliottCorrection 3 overloadsDesktopCLICloudChartElliottCorrection Draws an Elliott Correction Wave (A-B-C).
DrawElliottDoubleCombo 3 overloadsDesktopCLICloudChartElliottDoubleCombo Draws an Elliott Double Combo Wave (W-X-Y).
DrawElliottImpulse 3 overloadsDesktopCLICloudChartElliottImpulse Draws an Elliott Impulse Wave (1-2-3-4-5).
DrawElliottTriangle 3 overloadsDesktopCLICloudChartElliottTriangle Draws an Elliott Triangle Wave (A-B-C-D-E).
DrawElliottTripleCombo 3 overloadsDesktopCLICloudChartElliottTripleCombo Draws an Elliott Triple Combo Wave (W-X-Y-X-Z).
DrawEllipse 6 overloadsDesktopCLICloudChartEllipse Draws an ellipse.
DrawEquidistantChannel 6 overloadsDesktopCLICloudChartEquidistantChannel Draws an equidistant channel.
DrawFibonacciArc 6 overloadsDesktopCLICloudChartFibonacciArc Draws a Fibonacci arc.
DrawFibonacciExpansion 6 overloadsDesktopCLICloudChartFibonacciExpansion Draws a Fibonacci expansion.
DrawFibonacciFan 6 overloadsDesktopCLICloudChartFibonacciFan Draws a Fibonacci fan.
DrawFibonacciRetracement 6 overloadsDesktopCLICloudChartFibonacciRetracement Draws a Fibonacci retracement.
DrawFibonacciTimezones 6 overloadsDesktopCLICloudChartFibonacciTimezones Draws a Fibonacci timezones.
DrawGannBox 6 overloadsDesktopCLICloudChartGannBox Draws a Gann box.
DrawGannFan 6 overloadsDesktopCLICloudChartGannFan Draws a Gann fan.
DrawGannSquare 6 overloadsDesktopCLICloudChartGannSquare Draws a Gann square.
DrawGannSquareFixed 6 overloadsDesktopCLICloudChartGannSquareFixed Draws a Gann square fixed.
DrawHorizontalLine 3 overloadsDesktopCLICloudChartHorizontalLine Draws a horizontal line.
DrawIcon 2 overloadsDesktopCLICloudChartIcon Draws an icon.
DrawRectangle 6 overloadsDesktopCLICloudChartRectangle Draws a rectangle.
DrawStaticTextDesktopCLICloudChartStaticText Draws the static text.
DrawText 2 overloadsDesktopCLICloudChartText Draws the text.
DrawTrendLine 6 overloadsDesktopCLICloudChartTrendLine Draws a trend line.
DrawTriangle 6 overloadsDesktopCLICloudChartTriangle Draws a triangle.
DrawVerticalLine 6 overloadsDesktopCLICloudChartVerticalLine Draws a vertical line.
FindAllObjects 2 overloadsDesktopCLICloudT[] Finds all the chart objects of the specified type.
FindObjectDesktopCLICloudChartObject Finds the chart object of the specified name.
MoveControl 5 overloadsDesktopCLICloudvoid Moves a chart control to chart / indicator area on absolute bar index and price (x,y) coordinates.
RemoveAllObjectsDesktopCLICloudvoid Removes all interactive and non-interactive objects available for the cBot or Indicator.
RemoveControlDesktopCLICloudvoid Remove a chart control from the chart area.
RemoveObjectDesktopCLICloudvoid Removes the chart object of the specified name.
ResetPriceScaleDesktopCLICloudvoid Resets the price scale of the chart area to its default state: enables the auto scale and fits the Y-axis range to the visible bars and outputs. Does not change the price scale mode, the inversion or the price axis position. Ignored on the main chart area while the price to bar ratio is locked. Does nothing in the silent backtesting, the CLI and the cloud.
SetYRangeDesktopCLICloudvoid Sets the Y-axis lowest and highest values range. Allows scrolling the chart by the Y-axis. If only one of the values is set, then the chart will be expanded regarding the lowest or highest value respectively. A range whose lowest value is not lower than its highest value is ignored, and so is any range on the main chart area while the price scale mode is Percent or IndexedTo100.
TimeToXDesktopCLIClouddouble Converts area Time coordinate to Mouse X coordinate value.
XToBarIndexDesktopCLIClouddouble Converts X coordinate to bar index.
XToTimeDesktopCLICloudDateTime Converts Mouse X coordinate to area Time coordinate value.
YToYValueDesktopCLIClouddouble Converts Mouse Y coordinate to area Y axis coordinate value.
YValueToYDesktopCLIClouddouble Converts Area Y axis coordinate value to mouse Y coordinate.

Properties

Name Description
BottomYDesktopCLIClouddouble Gets the lowest visible Y-axis value.
DraggablesDesktopCLICloudChartDraggables Gets chart area draggables.
HeightDesktopCLIClouddouble Gets the hight of the chart area.
IsAliveDesktopCLICloudbool Checks whether the instance is still on the chart area.
IsAutoScaleEnabledDesktopCLICloudbool Gets or sets the value indicating whether the auto scale is enabled for the chart area. When enabled, the Y-axis range is fitted automatically to the visible bars and outputs while the chart scrolls. Setting the Y-axis range with SetYRange, or dragging the price axis, disables the auto scale. On the main chart area the auto scale is always enabled while the price scale mode is Percent or IndexedTo100, and is always disabled while the price to bar ratio is locked; setting it to a conflicting value in these states is ignored. In the silent backtesting, the CLI and the cloud the value is only stored and has no visual effect.
ObjectsDesktopCLICloudIReadonlyList<ChartObject> Gets the chart objects collection.
SelectedObjectsDesktopCLICloudIReadonlyList<ChartObject> Gets the list of currently selected objects if any.
TopYDesktopCLIClouddouble Gets the highest visible Y-axis value.
WidthDesktopCLIClouddouble Gets the width of the chart area.

Events

Name Description
DragDesktopCLICloudAction<ChartDragEventArgs> Occurs when dragging a chart area.
DragEndDesktopCLICloudAction<ChartDragEventArgs> Occurs when mouse button is released while dragging a chart area or a chart area loses mouse capture.
DragStartDesktopCLICloudAction<ChartDragEventArgs> Occurs when MouseDown event is happening on a chart area and a mouse is captured for dragging.
MouseDownDesktopCLICloudAction<ChartMouseEventArgs> Occurs when the left mouse button is pressed down.
MouseEnterDesktopCLICloudAction<ChartMouseEventArgs> Occurs when the cursor hover over the chart area.
MouseLeaveDesktopCLICloudAction<ChartMouseEventArgs> Occurs when the cursor leaves the chart area
MouseMoveDesktopCLICloudAction<ChartMouseEventArgs> Occurs when the cursor moves over the chart area.
MouseUpDesktopCLICloudAction<ChartMouseEventArgs> Occurs when the left mouse button is released.
MouseWheelDesktopCLICloudAction<ChartMouseWheelEventArgs> Occurs when the mouse wheel button is rotated.
ObjectHoverChangedDesktopCLICloudAction<ChartObjectHoverChangedEventArgs> Occurs when the cursor hovers over or leaves the object.
ObjectsAddedDesktopCLICloudAction<ChartObjectsAddedEventArgs> Occurs when one or several chart objects are added to the chart area.
ObjectsMoveEndedDesktopCLICloudAction<ChartObjectsMoveEndedEventArgs> Occurs when one or several chart objects are moved.
ObjectsMoveStartedDesktopCLICloudAction<ChartObjectsMoveStartedEventArgs> Occurs when one or several chart objects move started.
ObjectsMovingDesktopCLICloudAction<ChartObjectsMovingEventArgs> Occurs when one or several chart objects are moving.
ObjectsRemovedDesktopCLICloudAction<ChartObjectsRemovedEventArgs> Occurs when one or several chart object are removed from the chart area.
ObjectsSelectionChangedDesktopCLICloudAction<ChartObjectsSelectionChangedEventArgs> Occurs when chart objects are selected or deselected.
ObjectsUpdatedDesktopCLICloudAction<ChartObjectsUpdatedEventArgs> Occurs when one or several chart objects are updated.
PriceScaleChangedDesktopCLICloudAction<ChartPriceScaleEventArgs> Occurs when the price scale state of the chart area changes: the auto scale is enabled or disabled, or the price scale is reset. On the main chart area it also occurs when any chart level price scale setting changes: the price scale mode, the inversion, the price to bar ratio lock or value, the scale price chart only option or the price axis position. Not raised in the silent backtesting, the CLI and the cloud.
ScrollChangedDesktopCLICloudAction<ChartScrollEventArgs> Occurs when the X-axis position value or the Y-axis position value changes while scrolling.
SizeChangedDesktopCLICloudAction<ChartSizeEventArgs> Occurs when the chart area size has changed.
Deprecated members (4)
  • event Action<ChartObjectAddedEventArgs> ObjectAdded; — Use ObjectsAdded instead
  • event Action<ChartObjectUpdatedEventArgs> ObjectUpdated; — Use ObjectsUpdated instead
  • event Action<ChartObjectRemovedEventArgs> ObjectRemoved; — Use ObjectsRemoved instead
  • event Action<ChartObjectSelectionChangedEventArgs> ObjectSelectionChanged; — Use ObjectsSelectionChanged instead