Przejdź do treści

Szablony wykresów

Kolekcja ChartTemplates i obiekty ChartTemplate umożliwiają programowe zapisywanie, zarządzanie i stosowanie szablonów wykresów, bez konieczności ręcznej konfiguracji. Ta funkcjonalność jest przydatna dla:

  • Traderów, którzy chcą, aby algorytmy konfigurowały i obsługiwały spójne układy wykresów, płynne przełączanie szablonów, przechwytywanie i przechowywanie ustawień, monitorowanie i więcej.
  • Deweloperów, którzy potrzebują powtarzalnych środowisk wykresów do zaawansowanej analizy, monitorowania, debugowania lub wdrażania pomocniczych wskaźników i cBotów na wielu wykresach.

Podstawowe koncepcje

Pojedynczy ChartTemplate udostępnia:

  • template.Apply(Chart), aby zastosować szablon do wykresu docelowego.
  • template.Indicators, aby dodawać lub usuwać wskaźniki, uzyskiwać dostęp do ich parametrów.
  • template.Robots, aby dodawać lub usuwać cBoty.
  • template.ColorSettings, aby pracować z kolorami wykresu lub motywu
  • template.DisplaySettings, aby pracować z typem wykresu, powiększeniem i różnymi przełącznikami, w tym pozycjami, zleceniami, siatką, sentymentem i innymi.

Obiekt ChartTemplates, wbudowana kolekcja, zapewnia:

  • foreach (var t in ChartTemplates) ... do wyliczania.
  • ChartTemplates.Get(name), ChartTemplates.Contains(name) do odpytywania.
  • ChartTemplates.Create(name) do tworzenia pustych szablonów.
  • ChartTemplates.Create(name, Chart) do przechwytywania bieżącej konfiguracji wykresu.
  • ChartTemplates.Duplicate(newName, sourceTemplate) do duplikowania szablonów.
  • ChartTemplates.Remove(template) do usuwania szablonów.
  • ChartTemplates.DefaultTemplate do stosowania domyślnego szablonu (pobieranie lub ustawianie).

Udostępnia również zdarzenia:

  • ChartTemplates.Added += ...
  • ChartTemplates.Removed += ...

Poniższa tabela zawiera podsumowanie standardowych operacji.

Operacja Przykłady
Cykl życia szablonu Utwórz pusty szablon
Utwórz szablon z bieżącego wykresu
Duplikuj szablon
Usuń szablon
Odkrywanie szablonów Wyświetl listę szablonów i pokaż dane
Sprawdź, czy szablon istnieje
Reaguj na dodanie lub usunięcie szablonu
Stosowanie szablonów Zastosuj szablon do wykresu
Zmień domyślny szablon
Kompozycja szablonu Dodaj lub usuń wskaźnik
Zmodyfikuj parametry wskaźnika
Dodaj lub usuń cBota
Ustawienia układu i wizualizacji Ustaw kolory wykresu
Włącz lub wyłącz opcje wyświetlania wykresu
Zmień typ wykresu
Dostosuj poziom powiększenia

Rozważ cBota Chart Templates Manager, który po dodaniu i uruchomieniu na wykresie wyświetla menu do wykonywania różnych zadań z szablonami wykresów.

Kod
  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);
        }
    }
}

Praktyczne zastosowania

Przechwytywanie bieżącej konfiguracji

Twórz algorytmy, które programowo przechwytują ustawienia wykresu, w tym wskaźniki, parametry, kolory i inne, i zapisują je jako szablon. Pozwala to automatycznie zachować działającą konfigurację podczas dowolnej fazy handlu algorytmicznego i zastosować ją do dowolnych innych wykresów.

Ten kod C# demonstruje cBota, który przechwytuje i przechowuje szablon wykresu:

 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}");
        }
    }
}

Twórz odrębne obszary robocze

Uporządkuj swój dyskrecjonalny przepływ pracy w trzy dedykowane układy wykresów i przełączaj się między nimi natychmiast. Typowy dyskrecjonalny przepływ pracy to:

  • Skanowanie – minimalny wykres, szybkie ładowanie, czyste świece, brak bałaganu.
  • Potwierdzenie – wskaźniki i nakładki kontekstowe, takie jak filtry trendu/zmienności.
  • Wykonanie – pokaż zlecenia/pozycje/cele i przyciski szybkiej transakcji, ukryj wszystko, co rozprasza.
1
2
3
4
5
private void ApplyWorkspace(string name)
{
    if (ChartTemplates.Contains(name))
        ChartTemplates.Get(name).Apply(Chart);
}

Standaryzuj handel trendami

Podczas handlu trendami zazwyczaj polegasz na trzech podstawowych elementach: filtrze trendu, takim jak EMA, mierze momentum lub wykupienia-wyprzedania, takiej jak RSI, oraz czystym wykresie świecowym ze stabilnymi kolorami i czytelnymi nakładkami. Możesz zapisać tę konfigurację jako pojedynczy szablon i zastosować ją do dowolnego symbolu lub przedziału czasowego, który otworzysz.

Ustandaryzowana konfiguracja pomaga uniknąć niespójności parametrów, zmniejszyć błędy konfiguracji i zapewnić, że każdy wykres podąża za tymi samymi ramami decyzyjnymi.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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);

Twórz układy powrotu do średniej

Podczas handlu powrotem do średniej często polegasz na większym kontekście wskaźników, ale nadal chcesz czystego i kontrolowanego wykresu. Użyj szablonów, aby zdecydować dokładnie, co pozostaje widoczne podczas analizy.

Wyłącz przyciski szybkiej transakcji, aby zapobiec przypadkowym wejściom. Ukryj panel nastrojów, jeśli cię rozprasza. Zachowaj widoczność siatki i kluczowych poziomów dla precyzyjnego pozycjonowania. Wybierz typ wykresu, który pasuje do twojego podejścia, czy to świecowy dla struktury, czy liniowy dla przejrzystości.

1
2
3
4
5
6
7
8
9
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);

Buduj szablony monitorowania

Gdy jesteś w transakcji, twoje priorytety się zmieniają. Potrzebujesz wyraźnej widoczności otwartych pozycji, zleceń oczekujących i poziomów docelowych, wraz ze stabilnym i spójnym widokiem wykresu. Utrzymuj stały poziom powiększenia, upewnij się, że linie cenowe są wyraźnie wyświetlane i usuń wskaźniki, które nie wspierają bezpośrednio decyzji zarządczych.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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);

Egzekwuj standardy wizualne

Jeśli pracujesz w zespole lub stosujesz określony styl stanowiska pracy, użyj szablonów do standaryzacji elementów, takich jak kolor tła, kolory świec byka i niedźwiedzia, widoczność siatki i stylizacja linii. Zastosuj ten sam szablon we wszystkich wykresach, aby zapewnić jednolitą strukturę wizualną, zmniejszyć zamieszanie i poprawić komunikację.

Ta konfiguracja staje się szczególnie ważna, gdy udostępniasz zrzuty ekranu, przeprowadzasz przeglądy strategii lub przekazujesz decyzje.

1
2
3
4
5
6
7
8
9
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);

Dodaj szablony zmienności

Gdy zmienność się zmienia, zmieniają się twoje potrzeby wykonawcze i analityczne. Utwórz szablony, aby zdefiniować dwa odrębne obszary robocze i przełączaj się między nimi w miarę ewolucji warunków:

  • W szablonie niskiej zmienności użyj ciaśniejszego powiększenia, zmniejsz nakładki i utrzymuj czysty widok odpowiedni dla handlu w zakresie.
  • W szablonie wysokiej zmienności użyj szerszego powiększenia, wyraźniejszych linii cenowych, włącz siatkę i wyświetl pozycje oraz zlecenia dla ściślejszej kontroli wykonania.
1
2
3
4
5
6
private void ApplyRegimeTemplate(bool highVol)
{
    var name = highVol ? "HighVol" : "LowVol";
    if (ChartTemplates.Contains(name))
        ChartTemplates.Get(name).Apply(Chart);
}

Twórz konteksty jednym kliknięciem

Często używasz różnych parametrów wskaźników, poziomów powiększenia i preferencji wizualnych w zależności od tego, czy scalpujesz, czy handlujesz swingowo. Zamiast ręcznie dostosowywać ustawienia za każdym razem, gdy zmieniasz przedziały czasowe, utwórz dedykowane szablony dla każdego widoku.

Na przykład zdefiniuj M1-Scalp dla szybkiego wykonania i ciaśniejszego powiększenia, M15-Intraday dla ustrukturyzowanego handlu sesyjnego oraz H1-Swing dla szerszego kontekstu i gładszych nakładek.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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);
}

Buduj podręczniki strategii

Jeśli handlujesz wieloma rodzinami strategii, rozważ zdefiniowanie dedykowanego szablonu dla każdego podręcznika. Na przykład możesz:

  • Użyć szablonu podręcznika wybicia z włączoną siatką, widocznymi zleceniami i pozycjami, szerszym powiększeniem i czystymi liniami cenowymi dla przejrzystości wykonania.
  • Użyć szablonu podręcznika cofnięcia z zastosowanymi EMA i RSI, normalnym poziomem powiększenia i widocznymi tytułami wskaźników.
  • Użyć szablonu podręcznika odwrócenia z dodatkowymi wskaźnikami kontekstowymi i typem świecy, który podkreśla knoty i strukturę.

Mając każdy podręcznik zakodowany jako szablon, możesz przełączać środowiska w oparciu o typ sygnału i utrzymywać wykonanie zgodne ze stosowaną strategią.

 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);
}