Chart templates
The ChartTemplates collection and ChartTemplate objects allow you to programmatically save, manage and apply chart templates, without having to deal with manual configurations. This functionality is useful for:
- Traders who want algorithms to configure and handle consistent chart layouts, smooth template switching, setup capturing and storage, monitoring and more.
- Developers who need repeatable chart environments for advanced analysis, monitoring, debugging or deployment of helper indicators and cBots across many charts.
Core concepts
A single ChartTemplate exposes:
template.Apply(Chart) to apply a template to a target chart. template.Indicators to add or remove indicators, access their parameters. template.Robots to add or remove cBots. template.ColorSettings to work with chart or theme colours template.DisplaySettings to work with chart type, zoom and various toggles, including positions, orders, grid, sentiment and more.
The ChartTemplates object, a built-in collection, provides:
foreach (var t in ChartTemplates) ... for enumeratation. ChartTemplates.Get(name), ChartTemplates.Contains(name) for querying. ChartTemplates.Create(name) for creating empty templates. ChartTemplates.Create(name, Chart) for capturing the current chart configuration. ChartTemplates.Duplicate(newName, sourceTemplate) for duplicating templates. ChartTemplates.Remove(template) for removing templates. ChartTemplates.DefaultTemplate for applying the default template (get or set).
It also exposes events:
ChartTemplates.Added += ... ChartTemplates.Removed += ...
The table below provides a summary of standard operations.
| Operation | Examples |
| Template lifecycle | Create an empty template Create a template from the current chart Duplicate a template Remove a template |
| Template discovery | List templates and show data Check if a template exists React to a template being added or removed |
| Applying templates | Apply a template to a chart Change default template |
| Template composition | Add or remove an indicator Modify the parameters of an indicator Add or remove a cBot |
| Layout and visualisation settings | Set the chart colours Enable or disable the chart display options Change the chart type Adjust the zoom level |
Consider a Chart Templates Manager cBot, which when added and started on a chart, displays a menu for performing various tasks with chart templates.
Code
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405 | using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using System.Linq;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None, AddIndicators = true)]
public class ChartTemplatesManager : Robot
{
protected override void OnStart()
{
var templatesComboBox = new ComboBox();
templatesComboBox.AddItem("Click to view available templates");
templatesComboBox.SelectedItem = "Click to view available templates";
foreach (var template in ChartTemplates)
{
templatesComboBox.AddItem(template.Name);
}
ChartTemplates.Added += args =>
{
templatesComboBox.AddItem(args.ChartTemplate.Name);
Print($"A new template was added: {args.ChartTemplate.Name}");
};
ChartTemplates.Removed += args =>
{
templatesComboBox.RemoveItem(args.ChartTemplate.Name);
Print($"A template was removed: {args.ChartTemplate.Name}");
};
var showTemplateInfoButton = new Button { Text = "Show the template information" };
showTemplateInfoButton.Click += args =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
Print($"Name: {template.Name} | Bots #: {template.Robots.Count} | Indicators #: {template.Indicators.Count}");
};
var showDefaultTemplateInfoButton = new Button { Text = "Show the default template information" };
showDefaultTemplateInfoButton.Click += args =>
{
Print($"Name: {ChartTemplates.DefaultTemplate.Name} | Bots #: {ChartTemplates.DefaultTemplate.Robots.Count} | Indicators #: {ChartTemplates.DefaultTemplate.Indicators.Count}");
};
var removeTemplateButton = new Button { Text = "Remove the selected template" };
removeTemplateButton.Click += _ => ChartTemplates.Remove(ChartTemplates.Get(templatesComboBox.SelectedItem));
var applyTemplateButton = new Button { Text = "Apply the selected template" };
applyTemplateButton.Click += _ => ChartTemplates.Get(templatesComboBox.SelectedItem).Apply(Chart);
var duplicateTemplateButton = new Button { Text = "Duplicate the selected template" };
duplicateTemplateButton.Click += _ => ChartTemplates.Duplicate($"{templatesComboBox.SelectedItem} Duplicate", ChartTemplates.Get(templatesComboBox.SelectedItem));
var createTemplateTextBox = new TextBox { Text = "Click to type in a template name" };
var createEmptyTemplateButton = new Button { Text = "Create an empty template" };
createEmptyTemplateButton.Click += _ => ChartTemplates.Create(createTemplateTextBox.Text);
var createTemplateBasedOnChartButton = new Button { Text = "Create a template from the current chart" };
createTemplateBasedOnChartButton.Click += _ => ChartTemplates.Create(createTemplateTextBox.Text, Chart);
var changeDefaultTemplateToSelectedButton = new Button { Text = "Set the selected template as the default" };
changeDefaultTemplateToSelectedButton.Click += _ => ChartTemplates.DefaultTemplate = ChartTemplates.Get(templatesComboBox.SelectedItem);
var checkSelectedTemplateExistsButton = new Button { Text = "Check whether the selected template exists" };
checkSelectedTemplateExistsButton.Click += _ => Print($"The template '{templatesComboBox.SelectedItem}' exists: {ChartTemplates.Contains(templatesComboBox.SelectedItem)}");
var removeSelectedTemplateIndicator = new Button { Text = "Remove an indicator from the selected template" };
removeSelectedTemplateIndicator.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
if (template.Indicators.Count == 0)
return;
Print($"Removal result: {template.Indicators.Remove(template.Indicators.First())}");
};
var removeSelectedTemplateBot = new Button { Text = "Remove a cBot from the selected template" };
removeSelectedTemplateBot.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
if (template.Robots.Count == 0)
return;
Print($"Removal result: {template.Robots.Remove(template.Robots.First())}");
};
var indicatorsCombobox = new ComboBox();
indicatorsCombobox.AddItem("Click to select an indicator");
indicatorsCombobox.SelectedItem = "Click to select an indicator";
foreach (var indicator in AlgoRegistry.Indicators.OrderBy(i => i.Name))
{
indicatorsCombobox.AddItem(indicator.Name);
}
var addIndicatorWithDefaultParametersToSelectedTemplate = new Button { Text = "Add the selected indicator to the selected template using default parameters" };
addIndicatorWithDefaultParametersToSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
if (string.IsNullOrWhiteSpace(indicatorsCombobox.SelectedItem))
{
Print("No indicator is selected.");
return;
}
Print($"Added the indicator {indicatorsCombobox.SelectedItem}.");
template.Indicators.Add(indicatorsCombobox.SelectedItem);
};
var robotsCombobox = new ComboBox();
robotsCombobox.AddItem("Click to select a cBot");
robotsCombobox.SelectedItem = "Click to select a cBot";
foreach (var robot in AlgoRegistry.Robots.OrderBy(i => i.Name))
{
robotsCombobox.AddItem(robot.Name);
}
var addRobotWithDefaultParametersToSelectedTemplate = new Button { Text = "Add the selected cBot to the selected template using default parameters" };
addRobotWithDefaultParametersToSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
if (string.IsNullOrWhiteSpace(robotsCombobox.SelectedItem))
{
Print("No cBot is selected.");
return;
}
Print($"Added the cBot {robotsCombobox.SelectedItem}.");
template.Robots.Add(robotsCombobox.SelectedItem);
};
var addEmaIndicatorWithDifferentParametersToSelectedTemplate = new Button { Text = "Add an EMA indicator to the selected template using custom parameters" };
addEmaIndicatorWithDifferentParametersToSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
var emaType = AlgoRegistry.Get("Exponential Moving Average", AlgoKind.StandardIndicator) as IndicatorType;
Print($"Added the indicator {emaType.Name} with a period of 100.");
template.Indicators.Add(emaType, Bars.OpenPrices, 100);
};
var changeEmaIndicatorParametersForSelectedTemplate = new Button { Text = "Change the EMA indicator parameters in the selected template" };
changeEmaIndicatorParametersForSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
var emaType = AlgoRegistry.Get("Exponential Moving Average", AlgoKind.StandardIndicator) as IndicatorType;
if (template.Indicators.FirstOrDefault(i => i.Type == emaType) is not { } templateIndicator)
{
Print($"The EMA indicator was not found in the template '{template.Name}'.");
return;
}
Print($"Changing the indicator {emaType.Name} period to 200.");
templateIndicator.Parameters["Periods"].Value = 200;
};
var setAllColorSettingsToRedForSelectedTemplate = new Button { Text = "Set all colour settings to red for the selected template" };
setAllColorSettingsToRedForSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
template.ColorSettings.AskPriceLineColor = Color.Red;
template.ColorSettings.BidPriceLineColor = Color.Red;
template.ColorSettings.BackgroundColor = Color.Red;
template.ColorSettings.BearFillColor = Color.Red;
template.ColorSettings.BearOutlineColor = Color.Red;
template.ColorSettings.BullFillColor = Color.Red;
template.ColorSettings.BullOutlineColor = Color.Red;
template.ColorSettings.BuyColor = Color.Red;
template.ColorSettings.ForegroundColor = Color.Red;
template.ColorSettings.GridLinesColor = Color.Red;
template.ColorSettings.LosingDealColor = Color.Red;
template.ColorSettings.PeriodSeparatorColor = Color.Red;
template.ColorSettings.SellColor = Color.Red;
template.ColorSettings.TickVolumeColor = Color.Red;
template.ColorSettings.WinningDealColor = Color.Red;
template.ColorSettings.AreaFillColor = Color.Red;
};
var enableAllDisplayOptionsForSelectedTemplate = new Button { Text = "Enable all display options for the selected template" };
enableAllDisplayOptionsForSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
template.DisplaySettings.AskPriceLine = true;
template.DisplaySettings.Bars = true;
template.DisplaySettings.BidPriceLine = true;
template.DisplaySettings.ChartScale = true;
template.DisplaySettings.DealMap = true;
template.DisplaySettings.Grid = true;
template.DisplaySettings.IndicatorTitles = true;
template.DisplaySettings.MarketSentiment = true;
template.DisplaySettings.Orders = true;
template.DisplaySettings.PeriodSeparators = true;
template.DisplaySettings.Positions = true;
template.DisplaySettings.PriceAlerts = true;
template.DisplaySettings.PriceAxisOverlayButtons = true;
template.DisplaySettings.QuickTradeButtons = true;
template.DisplaySettings.Targets = true;
template.DisplaySettings.TickVolume = true;
template.DisplaySettings.AddRobotButton = true;
};
var disableAllDisplayOptionsForSelectedTemplate = new Button { Text = "Disable all display options for the selected template" };
disableAllDisplayOptionsForSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
template.DisplaySettings.AskPriceLine = false;
template.DisplaySettings.Bars = false;
template.DisplaySettings.BidPriceLine = false;
template.DisplaySettings.ChartScale = false;
template.DisplaySettings.DealMap = false;
template.DisplaySettings.Grid = false;
template.DisplaySettings.IndicatorTitles = false;
template.DisplaySettings.MarketSentiment = false;
template.DisplaySettings.Orders = false;
template.DisplaySettings.PeriodSeparators = false;
template.DisplaySettings.Positions = false;
template.DisplaySettings.PriceAlerts = false;
template.DisplaySettings.PriceAxisOverlayButtons = false;
template.DisplaySettings.QuickTradeButtons = false;
template.DisplaySettings.Targets = false;
template.DisplaySettings.TickVolume = false;
template.DisplaySettings.AddRobotButton = false;
};
var changeChartTypeForSelectedTemplate = new Button { Text = "Change the chart type for the selected template" };
changeChartTypeForSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
template.DisplaySettings.ChartType = template.DisplaySettings.ChartType switch
{
ChartType.Area => ChartType.Bars,
ChartType.Bars => ChartType.Candlesticks,
ChartType.Candlesticks => ChartType.Dots,
ChartType.Dots => ChartType.Hlc,
ChartType.Hlc => ChartType.Line,
_ => ChartType.Area
};
Print($"Changed the template '{template.Name}' chart type to '{template.DisplaySettings.ChartType}'.");
};
var changeZoomeLevelForSelectedTemplate = new Button { Text = "Change the zoom level for the selected template" };
changeZoomeLevelForSelectedTemplate.Click += _ =>
{
if (string.IsNullOrWhiteSpace(templatesComboBox.SelectedItem))
{
Print("No template is selected.");
return;
}
var template = ChartTemplates.Get(templatesComboBox.SelectedItem);
template.DisplaySettings.ZoomLevel = template.DisplaySettings.ZoomLevel switch
{
5 => 400,
400 => 5,
_ => 5
};
Print($"Changed the template '{template.Name}' zoom level to '{template.DisplaySettings.ZoomLevel}'.");
};
var panel = new StackPanel { Orientation = Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center };
panel.AddChild(templatesComboBox);
panel.AddChild(showTemplateInfoButton);
panel.AddChild(showDefaultTemplateInfoButton);
panel.AddChild(removeTemplateButton);
panel.AddChild(applyTemplateButton);
panel.AddChild(duplicateTemplateButton);
panel.AddChild(createTemplateTextBox);
panel.AddChild(createEmptyTemplateButton);
panel.AddChild(createTemplateBasedOnChartButton);
panel.AddChild(changeDefaultTemplateToSelectedButton);
panel.AddChild(checkSelectedTemplateExistsButton);
panel.AddChild(removeSelectedTemplateIndicator);
panel.AddChild(removeSelectedTemplateBot);
panel.AddChild(indicatorsCombobox);
panel.AddChild(addIndicatorWithDefaultParametersToSelectedTemplate);
panel.AddChild(robotsCombobox);
panel.AddChild(addRobotWithDefaultParametersToSelectedTemplate);
panel.AddChild(addEmaIndicatorWithDifferentParametersToSelectedTemplate);
panel.AddChild(changeEmaIndicatorParametersForSelectedTemplate);
panel.AddChild(setAllColorSettingsToRedForSelectedTemplate);
panel.AddChild(enableAllDisplayOptionsForSelectedTemplate);
panel.AddChild(disableAllDisplayOptionsForSelectedTemplate);
panel.AddChild(changeChartTypeForSelectedTemplate);
panel.AddChild(changeZoomeLevelForSelectedTemplate);
Chart.AddControl(panel);
}
}
}
|
Practical applications
Capture the current setup
Develop algorithms that programmatically capture a chart's settings, including indicators, parameters, colours and others, and store them as a template. This allows you to automatically preserve a working setup during any phase of algo trading and apply it to any other charts.
This C# code demonstrates a cBot that captures and stores the template of a chart:
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 | using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using System.Linq;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None)]
public class CaptureChartAsTemplate : Robot
{
[Parameter("Template Name", DefaultValue = "My Golden Layout")]
public string TemplateName { get; set; }
protected override void OnStart()
{
// If you want "overwrite", remove first (safe pattern).
if (ChartTemplates.Contains(TemplateName))
{
var existing = ChartTemplates.Get(TemplateName);
ChartTemplates.Remove(existing);
Print($"Removed existing template '{TemplateName}' to recapture.");
}
// Capture everything from the CURRENT chart (indicators/robots/colors/display settings).
var created = ChartTemplates.Create(TemplateName, Chart);
Print($"Captured template '{created.Name}' from current chart. " +
$"Indicators={created.Indicators.Count}, Robots={created.Robots.Count}");
}
}
}
|
Create distinct workspaces
Structure your discretionary workflow into three dedicated chart layouts and switch between them instantly. A common discretionary workflow is:
- Scan – minimal chart, fast loading, clean candles, no clutter.
- Confirm – indicators and context overlays, such as trend/volatility filters.
- Execute – show orders/positions/targets and quick trade buttons, hide anything distracting.
| private void ApplyWorkspace(string name)
{
if (ChartTemplates.Contains(name))
ChartTemplates.Get(name).Apply(Chart);
}
|
Standardise trend trading
You typically rely on three core elements when trading trends: a trend filter such as an EMA, a momentum or overbought-oversold measure such as RSI and a clean candlestick chart with stable colours and readable overlays. You can save this configuration as a single template and apply it to any symbol or timeframe you open.
A standardised setup helps you avoid parameter inconsistencies, reduce setup errors and ensure that every chart follows the same decision framework.
| var t = ChartTemplates.Get("Trend Setup");
t.Indicators.Add("Relative Strength Index");
var emaType = AlgoRegistry.Get("Exponential Moving Average", AlgoKind.StandardIndicator) as IndicatorType;
t.Indicators.Add(emaType, Bars.OpenPrices, 200);
t.DisplaySettings.ChartType = ChartType.Candlesticks;
t.DisplaySettings.ZoomLevel = 200;
t.Apply(Chart);
|
Create mean-reversion layouts
When trading mean reversion, you often rely on more indicator context, but you still want a clean and controlled chart. Use templates to decide exactly what remains visible during analysis.
Turn off quick trade buttons to prevent accidental entries. Hide the sentiment panel if it distracts you. Keep the grid and key levels visible for precise positioning. Choose the chart type that matches your approach, whether candlesticks for structure or a line chart for clarity.
| var mr = ChartTemplates.Get("Mean Reversion");
mr.DisplaySettings.QuickTradeButtons = false;
mr.DisplaySettings.MarketSentiment = false;
mr.DisplaySettings.Grid = true;
mr.DisplaySettings.Orders = true;
mr.DisplaySettings.Positions = true;
mr.Apply(Chart);
|
Build monitoring templates
When you are in a trade, your priorities change. You need clear visibility of open positions, pending orders and target levels, along with a stable and consistent chart view. Keep your zoom level fixed, ensure price lines are clearly displayed and remove indicators that do not directly support management decisions.
| var monitor = ChartTemplates.Get("Monitor");
monitor.DisplaySettings.Positions = true;
monitor.DisplaySettings.Orders = true;
monitor.DisplaySettings.Targets = true;
monitor.DisplaySettings.PriceAlerts = true;
monitor.DisplaySettings.IndicatorTitles = false; // reduce noise
monitor.DisplaySettings.ZoomLevel = 150;
monitor.Apply(Chart);
|
Enforce visual standards
If you work within a team or follow a defined workstation style, use templates to standardise elements such as background colour, bull and bear candle colours, grid visibility and line styling. Apply the same template across all charts to ensure a uniform visual structure, reduce confusion and improve communication.
This setup becomes especially important when you share screenshots, conduct strategy reviews or hand off decisions.
| var style = ChartTemplates.Get("House Style");
style.ColorSettings.BackgroundColor = Color.Black;
style.ColorSettings.ForegroundColor = Color.White;
style.ColorSettings.GridLinesColor = Color.Gray;
style.ColorSettings.BullFillColor = Color.Green;
style.ColorSettings.BearFillColor = Color.Red;
style.Apply(Chart);
|
Add volatility templates
When volatility shifts, your execution and analysis needs change. Create templates to define two distinct workspaces and switch between them as conditions evolve:
- In the low volatility template, use a tighter zoom, reduce overlays and maintain a clean view suited for range trading.
- In the high volatility template, use a wider zoom, clearer price lines, enable the grid and display positions and orders for tighter execution control.
| private void ApplyRegimeTemplate(bool highVol)
{
var name = highVol ? "HighVol" : "LowVol";
if (ChartTemplates.Contains(name))
ChartTemplates.Get(name).Apply(Chart);
}
|
Create one-click contexts
You often use different indicator parameters, zoom levels and visual preferences depending on whether you are scalping or swing trading. Instead of manually adjusting settings every time you switch timeframes, create dedicated templates for each view.
For example, define M1-Scalp for fast execution and tighter zoom, M15-Intraday for structured session trading and H1-Swing for broader context and smoother overlays.
| private void ApplyTimeframeWorkspace(TimeFrame tf)
{
var name =
tf == TimeFrame.Minute ? "M1-Scalp" :
tf == TimeFrame.Minute15 ? "M15-Intraday" :
"H1-Swing";
if (ChartTemplates.Contains(name))
ChartTemplates.Get(name).Apply(Chart);
}
|
Build strategy playbooks
If you trade multiple strategy families, consider defining a dedicated template for each playbook. For example, you can:
- Use a breakout playbook template with the grid enabled, orders and positions visible, a wider zoom and clean price lines for execution clarity.
- Use a pullback playbook template with EMA and RSI applied, a normal zoom level and indicator titles visible.
- Use a reversal playbook template with additional context indicators and a candle type that highlights wicks and structure.
With each playbook encoded as a template, you can switch environments based on signal type and keep your execution aligned with the strategy you are applying.
1
2
3
4
5
6
7
8
9
10
11
12
13 | private void ApplyPlaybook(string playbook)
{
var name = playbook switch
{
"Breakout" => "Breakout Playbook",
"Pullback" => "Pullback Playbook",
"Reversal" => "Reversal Playbook",
_ => "Scan"
};
if (ChartTemplates.Contains(name))
ChartTemplates.Get(name).Apply(Chart);
}
|