ATAS
Loading...
Searching...
No Matches
Chart managing

Chart management is carried out both using the chart settings menu, and by entering the appropriate parameters directly into the indicator. In this case, the indicator can be provided with fields for setting graphical parameters.
Essential chart parameters are accessible through the ChartInfo object.
Let's examine some properties of this object:

public class SampleChartManaging : ATAS.Indicators.Indicator
{
private decimal _barsSpacing = 1;
private decimal _barsWidth = 1;
private ChartVisualModes _modes;
private FootprintVisualModes _visualMode;
private FootprintContentModes _contentMode;
private FootprintColorSchemes _colorScheme;
private int _moveChartUpAndDown;
private decimal _changeRowsHeight = 3;
private int _scrollPrice;
[Range(1, 1000)]
public decimal BarsSpacing
{
get => _barsSpacing;
set
{
_barsSpacing = value;
ChartInfo?.PriceChartContainer?.SetCustomBarsSpacing(_barsSpacing);
RedrawChart();
}
}
[Range(1, 1000)]
public decimal BarsWidth
{
get => _barsWidth;
set
{
_barsWidth = value;
ChartInfo?.PriceChartContainer?.SetCustomBarsWidth(_barsWidth, false);
RedrawChart();
}
}
public ChartVisualModes ChartMode
{
get => _modes;
set
{
_modes = value;
if (ChartInfo != null)
ChartInfo.ChartVisualMode = value;
RedrawChart();
}
}
public FootprintContentModes FootprintContentMode
{
get => _contentMode;
set
{
_contentMode = value;
if (ChartInfo != null)
ChartInfo.FootprintContentMode = value;
}
}
public FootprintVisualModes FootprintVisualMode
{
get => _visualMode;
set
{
_visualMode = value;
if (ChartInfo != null)
ChartInfo.FootprintVisualMode = value;
}
}
public FootprintColorSchemes FootprintColorScheme
{
get => _colorScheme;
set
{
_colorScheme = value;
if (ChartInfo != null)
ChartInfo.FootprintColorScheme = value;
}
}
public int MoveChartUpAndDown
{
get => _moveChartUpAndDown;
set
{
var diff = _moveChartUpAndDown - value;
ChartInfo?.CoordinatesManager?.MoveChartUpAndDown(diff);
_moveChartUpAndDown = value;
}
}
[Range(1, 100)]
public decimal ChangeRowsHeight
{
get => _changeRowsHeight;
set
{
_changeRowsHeight = value;
ChartInfo?.CoordinatesManager?.ChangeRowsHeight(value);
}
}
public int ScrollPrice
{
get => _scrollPrice;
set
{
var diff = _scrollPrice - value;
ChartInfo?.CoordinatesManager?.ScrollPrice(diff);
_scrollPrice = value;
}
}
protected override void OnCalculate(int bar, decimal value)
{
}
protected override void OnDispose()
{
ChartInfo?.PriceChartContainer?.SetCustomBarsSpacing(null);
ChartInfo?.PriceChartContainer?.SetCustomBarsWidth(ChartInfo.PriceChartContainer.BarsWidth, false);
}
}
ChartVisualModes
Enumerates the visual modes available for displaying price chart data on a chart.
Definition ChartVisualModes.cs:7
FootprintVisualModes
Definition FootprintVisualModes.cs:8
FootprintContentModes
Definition FootprintContentModes.cs:8
FootprintColorSchemes
Definition FootprintColorSchemes.cs:8
Definition AsyncConnector.cs:2
Chart managing from indicator