ChartColorSettings
Summary
Represents the charts Color Settings.
Use the Color classes to set the chart Color Settings.
Signature
| public abstract interface ChartColorSettings
|
Namespace
cAlgo.API
Examples
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82 | using cAlgo.API;
namespace cAlgo
{
// This indicator allows you to change chart colors via chart controls
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class ChartColorSettingsSample : Indicator
{
private TextBox _askPriceLineColorTextBox;
private TextBox _bidPriceLineColorTextBox;
private TextBox _backgroundColorTextBox;
protected override void Initialize()
{
var grid = new Grid(10, 2)
{
BackgroundColor = Color.Gold,
Opacity = 0.6,
HorizontalAlignment = HorizontalAlignment.Left,
VerticalAlignment = VerticalAlignment.Bottom
};
var style = new Style();
style.Set(ControlProperty.Margin, 5);
style.Set(ControlProperty.FontWeight, FontWeight.ExtraBold);
style.Set(ControlProperty.ForegroundColor, Color.Red);
style.Set(ControlProperty.MinWidth, 100);
grid.AddChild(new TextBlock
{
Text = "Ask Price Line Color",
Style = style
}, 0, 0);
_askPriceLineColorTextBox = new TextBox
{
Text = Chart.ColorSettings.AskPriceLineColor.ToString(),
Style = style
};
grid.AddChild(_askPriceLineColorTextBox, 0, 1);
grid.AddChild(new TextBlock
{
Text = "Bid Price Line Color",
Style = style
}, 1, 0);
_bidPriceLineColorTextBox = new TextBox
{
Text = Chart.ColorSettings.BidPriceLineColor.ToString(),
Style = style
};
grid.AddChild(_bidPriceLineColorTextBox, 1, 1);
grid.AddChild(new TextBlock
{
Text = "Background Color",
Style = style
}, 2, 0);
_backgroundColorTextBox = new TextBox
{
Text = Chart.ColorSettings.BackgroundColor.ToString(),
Style = style
};
grid.AddChild(_backgroundColorTextBox, 2, 1);
var changeButton = new Button
{
Text = "Change",
Style = style
};
changeButton.Click += ChangeButton_Click;
grid.AddChild(changeButton, 9, 0);
Chart.AddControl(grid);
}
private void ChangeButton_Click(ButtonClickEventArgs obj)
{
Chart.ColorSettings.AskPriceLineColor = GetColor(_askPriceLineColorTextBox.Text);
Chart.ColorSettings.BidPriceLineColor = GetColor(_bidPriceLineColorTextBox.Text);
Chart.ColorSettings.BackgroundColor = GetColor(_backgroundColorTextBox.Text);
}
private Color GetColor(string colorString, int alpha = 255)
{
var color = colorString[0] == '#' ? Color.FromHex(colorString) : Color.FromName(colorString);
return Color.FromArgb(alpha, color);
}
public override void Calculate(int index)
{
}
}
}
|
Properties
BackgroundColor
Summary
Gets or sets the color of the chart background.
Signature
| public abstract Color BackgroundColor {get; set;}
|
Return Value
Color
ForegroundColor
Summary
Gets or sets the color of the chart foreground.
Signature
| public abstract Color ForegroundColor {get; set;}
|
Return Value
Color
GridLinesColor
Summary
Gets or sets the color of the grid lines.
Signature
| public abstract Color GridLinesColor {get; set;}
|
Return Value
Color
PeriodSeparatorColor
Summary
Gets or sets the color of the period separator.
Signature
| public abstract Color PeriodSeparatorColor {get; set;}
|
Return Value
Color
BullOutlineColor
Summary
Gets or sets the color of the bull candle or bar outline.
Signature
| public abstract Color BullOutlineColor {get; set;}
|
Return Value
Color
BearOutlineColor
Summary
Gets or sets the color of the bear candle or bar outline.
Signature
| public abstract Color BearOutlineColor {get; set;}
|
Return Value
Color
BullFillColor
Summary
Gets or sets the color of the bull candle fill.
Signature
| public abstract Color BullFillColor {get; set;}
|
Return Value
Color
BearFillColor
Summary
Gets or sets the color of the bear candle fill.
Signature
| public abstract Color BearFillColor {get; set;}
|
Return Value
Color
TickVolumeColor
Summary
Gets or sets the color of the tick volume.
Signature
| public abstract Color TickVolumeColor {get; set;}
|
Return Value
Color
WinningDealColor
Summary
Gets or sets the color of the winning deal.
Signature
| public abstract Color WinningDealColor {get; set;}
|
Return Value
Color
LosingDealColor
Summary
Gets or sets the color of the losing deal.
Signature
| public abstract Color LosingDealColor {get; set;}
|
Return Value
Color
AskPriceLineColor
Summary
Gets or sets the color of the ask price line.
Signature
| public abstract Color AskPriceLineColor {get; set;}
|
Return Value
Color
BidPriceLineColor
Summary
Gets or sets the color of the bid price line.
Signature
| public abstract Color BidPriceLineColor {get; set;}
|
Return Value
Color
BuyColor
Summary
Gets or sets the color of Buy positions and orders.
Signature
| public abstract Color BuyColor {get; set;}
|
Return Value
Color
SellColor
Summary
Gets or sets the color of Sell order positions and orders.
Signature
| public abstract Color SellColor {get; set;}
|
Return Value
Color