Skip to content

Price Charts

CChart

CChart is a class for simplified access to “Chart” graphic object properties.

Description

CChart class provides access to “Chart” object properties.

Declaration

class CChart : public CObject

Title

#include <Charts\Chart.mqh>

Inheritance hierarchy

CObject

CChart

Class Methods by Groups

Access to protected data
ChartIDGets identifier of the chart
General properties
ModeGets/sets the value of “Mode” property (bars, candles, or line)
ForegroundGets/sets the value of “Foreground” property
ShiftGets/sets the value of “Shift” property
ShiftSizeGets/sets the value of “ShiftSize” property (in percents)
AutoScrollGets/sets the value of “AutoScroll” property
ScaleGets/sets the value of “Scale” property
ScaleFixGets/sets the value of “ScaleFix” property (fixed chart scale or not)
ScaleFix_11Gets/sets the value of “ScaleFix_11” property (chart scale is 1:1, or not)
FixedMaxGets/sets the value of “FixedMax” property (fixed maximal price)
FixedMinGets/sets the value of “FixedMin” property (fixed minimal price)
ScalePPBGets/sets the value of “ScalePPB” property (scale is “point per bar” or not)
PointsPerBarGets/sets the value of “PointsPerBar” property (in points per bar)
Show properties
ShowOHLCGets/sets the value of “ShowOHLC” property
ShowLineBidGets/sets the value of “ShowLineBid” property
ShowLineAskGets/sets the value of “ShowLineAsk” property
ShowLastLineGets/sets the value of “ShowLastLine” property
ShowPeriodSepGets/sets the value of “ShowPeriodSep” property (show period separators)
ShowGridGets/sets the value of “ShowGrid” property
ShowVolumesGets/sets the value of “ShowVolumes” property (color for volumes and levels of opened positions)
ShowObjectDescrGets/sets the value of “ShowObjectDescr” property (show description for graphic objects)
ShowDateScaleSets the value of “ShowDateScale” property (date scale of the chart)
ShowPriceScaleSets the value of “ShowPriceScale” property (price scale of the chart)
Color properties
ColorBackgroundGets/sets the value of “ColorBackground” property (background color of the chart)
ColorForegroundGets/sets the value of “ColorForeground” property (color of axes, scale and OHLC strings of the chart)
ColorGridGets/sets the value of “ColorGrid” property (color of the grid)
ColorBarUpGets/sets the value of “ColorBarUp” property (color for bull bars, their shadow and candle body outlines)
ColorBarDownGets/sets the value of “ColorBarDown” property (color for bear bars, their shadow and candle body outlines)
ColorCandleBullGets/sets the value of “ColorCandleBull” property (body color of the bull candle)
ColorCandleBearGets/sets the value of “ColorCandleBear” property (body color of the bear candle)
ColorChartLineGets/sets the value of “ColorChartLine” property (color for line chart and Doji candles)
ColorVolumesGets/sets the value of “ColorVolumes” property (color for volumes and levels of opened positions)
ColorLineBidGets/sets the value of “ColorLineBid” property (color of Bid line)
ColorLineAskGets/sets the value of “ColorLineAsk” property (color of Ask line)
ColorLineLastGets/sets the value of “ColorLineLast” property (color of the last deal price line)
ColorStopLevelsGets/sets the value of “ColorStopLevels” property (color of the SL and TP levels)
Read only properties
VisibleBarsGets total number of visible chart bars
WindowsTotalGets total number of chart windows, including the chart indicator subwindows
WindowIsVisibleGets visibility flag of the specified chart subwindow
WindowHandleGets window handle of the chart (HWND)
FirstVisibleBarGets the number of the first visible bar of the chart
WidthInBarsGets window width in bars.
WidthInPixelsGets subwindow width in pixels.
HeightInPixelsGets subwindow height in pixels.
PriceMinGets minimal price of the specified subwindow
PriceMaxGets maximal price of the specified subwindow
Properties
AttachAssigns the current chart to the class instance
FirstChartAssigns the first chart of the client terminal to the class instance
NextChartAssigns the next chart of the client terminal to the class instance
OpenOpens chart with specified parameters and assign it to the class instance
DetachDetaches chart from the class instance
CloseCloses chart assigned to the class instance
BringToTopShow chart on top of other charts
EventObjectCreateSets a flag to send notifications of an event of new object creation on a chart
EventObjectDeleteSets a flag to send notifications of an event of object deletion on a chart
Indicators
IndicatorAddAdds an indicator with the specified handle into a specified chart subwindow
IndicatorDeleteRemoves an indicator with a specified name from the specified chart subwindow
IndicatorsTotalReturns the number of all indicators applied to the specified chart subwindow
IndicatorNameReturns the short name of the indicator on the specified chart subwindow
Navigation
NavigateNavigates the chart
Access to MQL5 API
SymbolGets symbol of the chart
PeriodGets period of the chart
RedrawRedraws chart, assigned to the class instance
GetIntegerThe function returns the value of the corresponding object property
SetIntegerSets new value for the property of the integer type
GetDoubleThe function returns the value of the corresponding object property
SetDoubleSets new value for the property of the double type
GetStringThe function returns the value of the corresponding object property
SetStringSets new value for the property of the string type
SetSymbolPeriodChanges symbol and period of the chart assigned to the class instance
ApplyTemplateApplies specified template to the chart
ScreenShotCreates screenshot of the specified chart and saves it to .gif file
WindowOnDroppedGets chart subwindow number corresponding to the object (expert or script) drop point
PriceOnDroppedGets price coordinate corresponding to the object (expert or script) drop point
TimeOnDroppedGets time coordinate corresponding to the object (expert or script) drop point
XOnDroppedGets X coordinate corresponding to the object (expert or script) drop point
YOnDroppedGets Y coordinate corresponding to the object (expert or script) drop point
Input/Output
virtual SaveSaves object parameters to file
virtual LoadLoads object parameters from file
virtual TypeGets graphic object type identifier

Methods inherited from class CObject

: Prev, Prev, Next, Next, Compare

Last updated on