Repository navigation
Expand file tree
/
Copy pathICT_SmartMoneyConcepts.cpp
More file actions
2250 lines (1950 loc) · 91 KB
/
Copy pathICT_SmartMoneyConcepts.cpp
File metadata and controls
2250 lines (1950 loc) · 91 KB
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
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//==============================================================================
// ICT Smart Money Concepts - Sierra Chart / ACSIL custom study
//------------------------------------------------------------------------------
// DLL Name : ICT_SmartMoneyConcepts
// Study Name : ICT Smart Money Concepts
//------------------------------------------------------------------------------
// Feature set
// 1. Market Structure Mapping
// - Break of Structure (BOS) external + internal
// - Change of Character (CHoCH / MSS) external + internal
// - Internal vs. External swing tracking
// - Strong / Weak highs and lows
// 2. Institutional Supply & Demand Arrays (PD Arrays)
// - Order Blocks (OB)
// - Breaker Blocks (failed OB flips polarity)
// - Mitigation Blocks (failure swing / no HH or LL before MSS)
// - Rejection Blocks (long wick rejection zones)
// 3. Price Imbalances & Inefficiencies
// - Fair Value Gaps (3 candle imbalance)
// - Opening / Volume Gaps (prior close -> next open)
// - Liquidity Voids (fast one directional legs)
// 4. Liquidity Pools & Sweeps
// - Equal Highs / Equal Lows (EQH / EQL)
// - Liquidity sweeps / stop hunts (pierce + reject)
// - Previous Day / Week / Month High & Low (with raid alerts)
// 5. Premium / Discount / Equilibrium + OTE band
//
// Every major event has its own individually switchable alert.
//------------------------------------------------------------------------------
// Build
// 1. Copy this file to <Sierra Chart>\ACS_Source\
// 2. Analysis >> Build Custom Studies DLL >> select this file (or Build All)
// 3. Analysis >> Studies >> Add Custom Study >> "ICT Smart Money Concepts"
//
// Notes
// * All structure / PD array logic is evaluated on CLOSED bars only, so the
// drawings never repaint. Optional intrabar alerts can be enabled.
// * Colors are taken from the Subgraphs tab, so every element is user
// configurable without editing code.
// * To draw the zones behind the price bars enable
// "Draw Study Underneath Main Price Graph" in the study settings.
//==============================================================================
#include "sierrachart.h"
#include <vector>
#include <cmath>
#include <cfloat>
SCDLLName("ICT_SmartMoneyConcepts")
//==============================================================================
// small helpers (avoid min/max macro collisions)
//==============================================================================
static inline float SMC_MaxF(float a, float b) { return (a > b) ? a : b; }
static inline float SMC_MinF(float a, float b) { return (a < b) ? a : b; }
static inline int SMC_MaxI(int a, int b) { return (a > b) ? a : b; }
static inline int SMC_MinI(int a, int b) { return (a < b) ? a : b; }
//==============================================================================
// Subgraph indexes (plot data + user editable color holders)
//==============================================================================
enum SMCSubgraphs
{
SG_SWEEP_BULL = 0, // marker: sell-side liquidity swept (bullish)
SG_SWEEP_BEAR, // marker: buy-side liquidity swept (bearish)
SG_BULL_STRUCT, // external bullish BOS / CHoCH color
SG_BEAR_STRUCT, // external bearish BOS / CHoCH color
SG_BULL_INT, // internal bullish structure color
SG_BEAR_INT, // internal bearish structure color
// --- zone colors : MUST stay in the same order as SMCZoneType ---
SG_BULL_OB,
SG_BEAR_OB,
SG_BULL_BRK,
SG_BEAR_BRK,
SG_BULL_MB,
SG_BEAR_MB,
SG_BULL_RB,
SG_BEAR_RB,
SG_BULL_FVG,
SG_BEAR_FVG,
SG_BULL_GAP,
SG_BEAR_GAP,
SG_BULL_VOID,
SG_BEAR_VOID,
// ----------------------------------------------------------------
SG_EQH,
SG_EQL,
SG_PREMIUM,
SG_DISCOUNT,
SG_EQUILIBRIUM,
SG_OTE,
SG_PDHL,
SG_PWHL,
SG_PMHL,
SG_STRONG,
SG_WEAK,
SG_ATR, // internal working array (hidden)
SG_COUNT
};
//==============================================================================
// Input indexes
//==============================================================================
enum SMCInputs
{
IN_SWING_LEN = 0,
IN_INT_LEN,
IN_CONFIRM,
IN_SHOW_EXT_STRUCT,
IN_SHOW_INT_STRUCT,
IN_SHOW_STRONG_WEAK,
IN_MAX_STRUCT_LABELS,
IN_SHOW_OB,
IN_OB_SOURCE,
IN_ZONE_DEF,
IN_INVALIDATION,
IN_SHOW_BRK,
IN_SHOW_MB,
IN_SHOW_RB,
IN_RB_WICK_RATIO,
IN_RB_MIN_WICK,
IN_INTERNAL_OB,
IN_SHOW_FVG,
IN_FVG_MIN,
IN_SHOW_GAP,
IN_GAP_MIN,
IN_SHOW_VOID,
IN_VOID_MIN_BARS,
IN_VOID_MIN_SIZE,
IN_FILL_METHOD,
IN_SHOW_EQ,
IN_EQ_LEN,
IN_EQ_TOL,
IN_EQ_MAXBARS,
IN_SHOW_SWEEP,
IN_SWEEP_PEN,
IN_MAX_LIQ,
IN_SHOW_PD,
IN_SHOW_OTE,
IN_SHOW_PDAY,
IN_SHOW_PWEEK,
IN_SHOW_PMONTH,
IN_ATR_LEN,
IN_ZONE_EXTEND,
IN_TRANSPARENCY,
IN_MAX_ZONES,
IN_FONT_SIZE,
IN_SHOW_LABELS,
IN_DELETE_INVALID,
IN_ALERTS_ON,
IN_ALERT_SOUND,
IN_ALERT_INTRABAR,
IN_AL_EXT_BOS,
IN_AL_EXT_CHOCH,
IN_AL_INT_BOS,
IN_AL_INT_CHOCH,
IN_AL_NEW_OB,
IN_AL_OB_TAP,
IN_AL_OB_INVALID,
IN_AL_BRK,
IN_AL_MB,
IN_AL_RB,
IN_AL_FVG_NEW,
IN_AL_FVG_FILL,
IN_AL_GAP,
IN_AL_VOID,
IN_AL_EQ,
IN_AL_SWEEP,
IN_AL_PD,
IN_AL_HTF,
IN_COUNT
};
//==============================================================================
// Zone types (bullish types are EVEN, bearish types are ODD)
//==============================================================================
enum SMCZoneType
{
ZT_BULL_OB = 0,
ZT_BEAR_OB,
ZT_BULL_BRK,
ZT_BEAR_BRK,
ZT_BULL_MB,
ZT_BEAR_MB,
ZT_BULL_RB,
ZT_BEAR_RB,
ZT_BULL_FVG,
ZT_BEAR_FVG,
ZT_BULL_GAP,
ZT_BEAR_GAP,
ZT_BULL_VOID,
ZT_BEAR_VOID,
ZT_COUNT
};
enum SMCZoneFamily
{
FAM_OB = 0, FAM_BRK, FAM_MB, FAM_RB, FAM_FVG, FAM_GAP, FAM_VOID, FAM_COUNT
};
static const char* const ZoneLabel[ZT_COUNT] =
{
"Bull OB", "Bear OB",
"Bull BB", "Bear BB",
"Bull MB", "Bear MB",
"Bull RB", "Bear RB",
"FVG", "FVG",
"Gap", "Gap",
"Void", "Void"
};
static inline bool ZoneIsBull(int Type) { return (Type % 2) == 0; }
static inline int ZoneFamily(int Type) { return Type / 2; }
//==============================================================================
// Reserved (fixed) drawing line numbers. Dynamic drawings start at 1000.
//==============================================================================
enum SMCFixedLines
{
LN_STRONG_HIGH = 10, LN_STRONG_LOW, LN_WEAK_HIGH, LN_WEAK_LOW,
LN_PREM_BOX = 20, LN_DISC_BOX, LN_EQ_LINE, LN_OTE_BOX,
LN_PREM_TXT, LN_DISC_TXT, LN_EQ_TXT, LN_OTE_TXT,
LN_PDH = 40, LN_PDL, LN_PWH, LN_PWL, LN_PMH, LN_PML,
LN_PDH_T = 50, LN_PDL_T, LN_PWH_T, LN_PWL_T, LN_PMH_T, LN_PML_T,
LN_DYNAMIC_BASE = 1000
};
//==============================================================================
// Persistent data structures
//==============================================================================
struct s_SMCZone
{
int Type;
int StartIndex; // bar the zone is anchored to
int Created; // bar the zone was created on
int EndIndex; // frozen right edge once invalidated
float Top;
float Bottom;
int Active;
int Tapped;
int Internal;
int WasBreaker;
int BoxLine;
int TextLine;
};
struct s_SMCLiq
{
int IsHigh; // 1 = EQH / buy side , 0 = EQL / sell side
int StartIndex;
int EndIndex;
float Price;
int Swept;
int Line;
int TextLine;
};
struct s_SMCPivot
{
int Index;
float Price;
int Crossed;
int Swept;
int Valid;
};
struct s_SMCState
{
std::vector<s_SMCZone> Zones;
std::vector<s_SMCLiq> Liq;
std::vector<int> StructLines;
s_SMCPivot SwHigh, SwLow, PrevSwHigh, PrevSwLow; // external
s_SMCPivot InHigh, InLow; // internal
s_SMCPivot EqHigh, EqLow; // equal high/low pivots
int SwTrend; // 1 bullish , -1 bearish , 0 undefined
int InTrend;
float RangeHigh, RangeLow;
int RangeHighIdx, RangeLowIdx;
int PDZone; // 1 premium , -1 discount , 0 equilibrium
// previous day / week / month
float CurDayH, CurDayL, PrevDayH, PrevDayL;
float CurWkH, CurWkL, PrevWkH, PrevWkL;
float CurMoH, CurMoL, PrevMoH, PrevMoL;
int DayKey, WkKey, MoKey;
int DayStartIdx, WkStartIdx, MoStartIdx;
int PDHTaken, PDLTaken, PWHTaken, PWLTaken, PMHTaken, PMLTaken;
int LastProcessed;
int LastArraySize;
int NextLine;
int NeedRefresh;
int IntrabarUpIdx, IntrabarDnIdx, IntrabarSweepIdx;
};
static void SMC_ResetPivot(s_SMCPivot& P)
{
P.Index = -1; P.Price = 0.0f; P.Crossed = 0; P.Swept = 0; P.Valid = 0;
}
static void SMC_ResetState(s_SMCState& S)
{
S.Zones.clear();
S.Liq.clear();
S.StructLines.clear();
SMC_ResetPivot(S.SwHigh); SMC_ResetPivot(S.SwLow);
SMC_ResetPivot(S.PrevSwHigh); SMC_ResetPivot(S.PrevSwLow);
SMC_ResetPivot(S.InHigh); SMC_ResetPivot(S.InLow);
SMC_ResetPivot(S.EqHigh); SMC_ResetPivot(S.EqLow);
S.SwTrend = 0; S.InTrend = 0;
S.RangeHigh = 0.0f; S.RangeLow = 0.0f;
S.RangeHighIdx = -1; S.RangeLowIdx = -1;
S.PDZone = 0;
S.CurDayH = S.CurWkH = S.CurMoH = -FLT_MAX;
S.CurDayL = S.CurWkL = S.CurMoL = FLT_MAX;
S.PrevDayH = S.PrevDayL = 0.0f;
S.PrevWkH = S.PrevWkL = 0.0f;
S.PrevMoH = S.PrevMoL = 0.0f;
S.DayKey = S.WkKey = S.MoKey = -1;
S.DayStartIdx = S.WkStartIdx = S.MoStartIdx = 0;
S.PDHTaken = S.PDLTaken = S.PWHTaken = S.PWLTaken = S.PMHTaken = S.PMLTaken = 0;
S.LastProcessed = -1;
S.LastArraySize = 0;
S.NextLine = LN_DYNAMIC_BASE;
S.NeedRefresh = 1;
S.IntrabarUpIdx = -1;
S.IntrabarDnIdx = -1;
S.IntrabarSweepIdx = -1;
}
//==============================================================================
// Drawing helpers
//==============================================================================
static void SMC_DeleteDrawing(SCStudyInterfaceRef sc, int LineNumber)
{
if (LineNumber > 0)
sc.DeleteACSChartDrawing(sc.ChartNumber, TOOL_DELETE_CHARTDRAWING, LineNumber);
}
static void SMC_DrawBox(SCStudyInterfaceRef sc, int LineNumber,
int BeginIndex, int EndIndex,
float Top, float Bottom,
unsigned int Color, int Transparency,
SubgraphLineStyles LineStyle)
{
if (LineNumber <= 0)
return;
s_UseTool Tool;
Tool.Clear();
Tool.ChartNumber = sc.ChartNumber;
Tool.Region = sc.GraphRegion;
Tool.DrawingType = DRAWING_RECTANGLEHIGHLIGHT;
Tool.LineNumber = LineNumber;
Tool.BeginIndex = BeginIndex;
Tool.EndIndex = EndIndex;
Tool.BeginValue = Top;
Tool.EndValue = Bottom;
Tool.Color = Color;
Tool.SecondaryColor = Color;
Tool.TransparencyLevel = Transparency;
Tool.LineWidth = 1;
Tool.LineStyle = LineStyle;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
Tool.AddAsUserDrawnDrawing = 0;
sc.UseTool(Tool);
}
static void SMC_DrawLine(SCStudyInterfaceRef sc, int LineNumber,
int BeginIndex, int EndIndex,
float BeginValue, float EndValue,
unsigned int Color, int Width,
SubgraphLineStyles LineStyle)
{
if (LineNumber <= 0)
return;
s_UseTool Tool;
Tool.Clear();
Tool.ChartNumber = sc.ChartNumber;
Tool.Region = sc.GraphRegion;
Tool.DrawingType = DRAWING_LINE;
Tool.LineNumber = LineNumber;
Tool.BeginIndex = BeginIndex;
Tool.EndIndex = EndIndex;
Tool.BeginValue = BeginValue;
Tool.EndValue = EndValue;
Tool.Color = Color;
Tool.LineWidth = Width;
Tool.LineStyle = LineStyle;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
Tool.AddAsUserDrawnDrawing = 0;
sc.UseTool(Tool);
}
static void SMC_DrawText(SCStudyInterfaceRef sc, int LineNumber,
int Index, float Value, const char* Text,
unsigned int Color, int FontSize, int Alignment, int Bold)
{
if (LineNumber <= 0 || Text == NULL || Text[0] == '\0')
return;
s_UseTool Tool;
Tool.Clear();
Tool.ChartNumber = sc.ChartNumber;
Tool.Region = sc.GraphRegion;
Tool.DrawingType = DRAWING_TEXT;
Tool.LineNumber = LineNumber;
Tool.BeginIndex = Index;
Tool.BeginValue = Value;
Tool.Color = Color;
Tool.FontSize = FontSize;
Tool.FontBold = Bold;
Tool.Text = Text;
Tool.TextAlignment = Alignment;
Tool.TransparentLabelBackground = 1;
Tool.AddMethod = UTAM_ADD_OR_ADJUST;
Tool.AddAsUserDrawnDrawing = 0;
sc.UseTool(Tool);
}
//==============================================================================
// Alert helper - never fires during a full recalculation of historical bars
//==============================================================================
static void SMC_Alert(SCStudyInterfaceRef sc, bool Enabled, int SoundNumber,
const SCString& Message)
{
if (!Enabled)
return;
if (SoundNumber <= 0)
sc.AddAlertLine(Message, 0);
else
sc.SetAlert(SoundNumber - 1, Message.GetChars());
}
//==============================================================================
// Pivot detection. Left side uses <= , right side uses < so that the most
// recent bar of an equal-high cluster becomes the pivot.
//==============================================================================
static bool SMC_IsPivotHigh(SCStudyInterfaceRef sc, int P, int Len)
{
if (P - Len < 0 || P + Len >= sc.ArraySize)
return false;
const float H = sc.High[P];
for (int k = P - Len; k < P; ++k)
if (sc.High[k] > H) return false;
for (int k = P + 1; k <= P + Len; ++k)
if (sc.High[k] >= H) return false;
return true;
}
static bool SMC_IsPivotLow(SCStudyInterfaceRef sc, int P, int Len)
{
if (P - Len < 0 || P + Len >= sc.ArraySize)
return false;
const float L = sc.Low[P];
for (int k = P - Len; k < P; ++k)
if (sc.Low[k] < L) return false;
for (int k = P + 1; k <= P + Len; ++k)
if (sc.Low[k] <= L) return false;
return true;
}
//==============================================================================
// Zone management
//==============================================================================
static void SMC_PruneZones(SCStudyInterfaceRef sc, s_SMCState& S, int Family, int MaxCount)
{
for (;;)
{
int Count = 0;
int Oldest = -1;
for (int k = 0; k < (int)S.Zones.size(); ++k)
{
if (ZoneFamily(S.Zones[k].Type) != Family)
continue;
++Count;
if (Oldest < 0)
Oldest = k;
}
if (Count <= MaxCount || Oldest < 0)
break;
SMC_DeleteDrawing(sc, S.Zones[Oldest].BoxLine);
SMC_DeleteDrawing(sc, S.Zones[Oldest].TextLine);
S.Zones.erase(S.Zones.begin() + Oldest);
}
}
static void SMC_AddZone(SCStudyInterfaceRef sc, s_SMCState& S,
int Type, int StartIndex, int CreatedIndex,
float Top, float Bottom, int Internal, int MaxPerFamily)
{
if (Top < Bottom)
{
const float T = Top; Top = Bottom; Bottom = T;
}
if (Top - Bottom < sc.TickSize * 0.5f)
{
Top += sc.TickSize * 0.5f;
Bottom -= sc.TickSize * 0.5f;
}
s_SMCZone Z;
Z.Type = Type;
Z.StartIndex = StartIndex;
Z.Created = CreatedIndex;
Z.EndIndex = -1;
Z.Top = Top;
Z.Bottom = Bottom;
Z.Active = 1;
Z.Tapped = 0;
Z.Internal = Internal;
Z.WasBreaker = 0;
Z.BoxLine = S.NextLine++;
Z.TextLine = S.NextLine++;
S.Zones.push_back(Z);
SMC_PruneZones(sc, S, ZoneFamily(Type), MaxPerFamily);
}
static void SMC_AddStructureDrawing(SCStudyInterfaceRef sc, s_SMCState& S,
int PivotIndex, int BreakIndex, float Price,
const char* Label, unsigned int Color,
SubgraphLineStyles LineStyle, int FontSize,
int ShowLabel, int MaxLabels)
{
const int LineNo = S.NextLine++;
const int TextNo = S.NextLine++;
SMC_DrawLine(sc, LineNo, PivotIndex, BreakIndex, Price, Price, Color, 1, LineStyle);
if (ShowLabel)
{
const int MidIndex = PivotIndex + (BreakIndex - PivotIndex) / 2;
SMC_DrawText(sc, TextNo, MidIndex, Price, Label, Color, FontSize,
DT_CENTER | DT_VCENTER, 0);
}
S.StructLines.push_back(LineNo);
S.StructLines.push_back(TextNo);
while ((int)S.StructLines.size() > MaxLabels * 2 && !S.StructLines.empty())
{
SMC_DeleteDrawing(sc, S.StructLines[0]);
S.StructLines.erase(S.StructLines.begin());
}
}
//==============================================================================
// MAIN STUDY
//==============================================================================
SCSFExport scsf_ICTSmartMoneyConcepts(SCStudyInterfaceRef sc)
{
//--------------------------------------------------------------------------
// Defaults
//--------------------------------------------------------------------------
if (sc.SetDefaults)
{
sc.GraphName = "ICT Smart Money Concepts";
sc.StudyDescription =
"ICT / Smart Money Concepts: market structure (BOS, CHoCH/MSS, internal "
"and external), PD arrays (order blocks, breaker blocks, mitigation "
"blocks, rejection blocks), imbalances (fair value gaps, opening gaps, "
"liquidity voids), liquidity pools (EQH/EQL, sweeps / stop hunts), "
"previous day/week/month levels and premium/discount/OTE pricing. "
"Includes an individually configurable alert for every major event.";
sc.GraphRegion = 0;
sc.AutoLoop = 0; // manual looping
sc.ValueFormat = VALUEFORMAT_INHERITED;
sc.FreeDLL = 0;
sc.DrawZeros = 0;
sc.CalculationPrecedence = LOW_PREC_LEVEL;
// ---------------- subgraphs / colors ----------------
sc.Subgraph[SG_SWEEP_BULL].Name = "Sweep - Sell Side Taken";
sc.Subgraph[SG_SWEEP_BULL].DrawStyle = DRAWSTYLE_TRIANGLE_UP;
sc.Subgraph[SG_SWEEP_BULL].PrimaryColor = RGB( 0, 210, 140);
sc.Subgraph[SG_SWEEP_BULL].LineWidth = 3;
sc.Subgraph[SG_SWEEP_BULL].DrawZeros = 0;
sc.Subgraph[SG_SWEEP_BEAR].Name = "Sweep - Buy Side Taken";
sc.Subgraph[SG_SWEEP_BEAR].DrawStyle = DRAWSTYLE_TRIANGLE_DOWN;
sc.Subgraph[SG_SWEEP_BEAR].PrimaryColor = RGB(235, 70, 90);
sc.Subgraph[SG_SWEEP_BEAR].LineWidth = 3;
sc.Subgraph[SG_SWEEP_BEAR].DrawZeros = 0;
sc.Subgraph[SG_BULL_STRUCT].Name = "Color - Bullish Structure";
sc.Subgraph[SG_BULL_STRUCT].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_STRUCT].PrimaryColor = RGB( 0, 190, 255);
sc.Subgraph[SG_BEAR_STRUCT].Name = "Color - Bearish Structure";
sc.Subgraph[SG_BEAR_STRUCT].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_STRUCT].PrimaryColor = RGB(255, 120, 0);
sc.Subgraph[SG_BULL_INT].Name = "Color - Internal Bullish";
sc.Subgraph[SG_BULL_INT].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_INT].PrimaryColor = RGB(120, 200, 230);
sc.Subgraph[SG_BEAR_INT].Name = "Color - Internal Bearish";
sc.Subgraph[SG_BEAR_INT].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_INT].PrimaryColor = RGB(230, 170, 120);
sc.Subgraph[SG_BULL_OB].Name = "Zone - Bullish Order Block";
sc.Subgraph[SG_BULL_OB].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_OB].PrimaryColor = RGB( 20, 140, 110);
sc.Subgraph[SG_BEAR_OB].Name = "Zone - Bearish Order Block";
sc.Subgraph[SG_BEAR_OB].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_OB].PrimaryColor = RGB(160, 40, 60);
sc.Subgraph[SG_BULL_BRK].Name = "Zone - Bullish Breaker";
sc.Subgraph[SG_BULL_BRK].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_BRK].PrimaryColor = RGB( 60, 190, 160);
sc.Subgraph[SG_BEAR_BRK].Name = "Zone - Bearish Breaker";
sc.Subgraph[SG_BEAR_BRK].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_BRK].PrimaryColor = RGB(210, 80, 110);
sc.Subgraph[SG_BULL_MB].Name = "Zone - Bullish Mitigation";
sc.Subgraph[SG_BULL_MB].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_MB].PrimaryColor = RGB( 90, 160, 220);
sc.Subgraph[SG_BEAR_MB].Name = "Zone - Bearish Mitigation";
sc.Subgraph[SG_BEAR_MB].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_MB].PrimaryColor = RGB(220, 140, 80);
sc.Subgraph[SG_BULL_RB].Name = "Zone - Bullish Rejection";
sc.Subgraph[SG_BULL_RB].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_RB].PrimaryColor = RGB(140, 200, 100);
sc.Subgraph[SG_BEAR_RB].Name = "Zone - Bearish Rejection";
sc.Subgraph[SG_BEAR_RB].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_RB].PrimaryColor = RGB(200, 100, 140);
sc.Subgraph[SG_BULL_FVG].Name = "Zone - Bullish FVG";
sc.Subgraph[SG_BULL_FVG].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_FVG].PrimaryColor = RGB( 70, 170, 130);
sc.Subgraph[SG_BEAR_FVG].Name = "Zone - Bearish FVG";
sc.Subgraph[SG_BEAR_FVG].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_FVG].PrimaryColor = RGB(190, 80, 90);
sc.Subgraph[SG_BULL_GAP].Name = "Zone - Bullish Opening Gap";
sc.Subgraph[SG_BULL_GAP].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_GAP].PrimaryColor = RGB(110, 190, 190);
sc.Subgraph[SG_BEAR_GAP].Name = "Zone - Bearish Opening Gap";
sc.Subgraph[SG_BEAR_GAP].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_GAP].PrimaryColor = RGB(190, 150, 110);
sc.Subgraph[SG_BULL_VOID].Name = "Zone - Bullish Liquidity Void";
sc.Subgraph[SG_BULL_VOID].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BULL_VOID].PrimaryColor = RGB( 90, 140, 200);
sc.Subgraph[SG_BEAR_VOID].Name = "Zone - Bearish Liquidity Void";
sc.Subgraph[SG_BEAR_VOID].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_BEAR_VOID].PrimaryColor = RGB(200, 120, 160);
sc.Subgraph[SG_EQH].Name = "Color - Equal Highs";
sc.Subgraph[SG_EQH].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_EQH].PrimaryColor = RGB(230, 80, 80);
sc.Subgraph[SG_EQL].Name = "Color - Equal Lows";
sc.Subgraph[SG_EQL].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_EQL].PrimaryColor = RGB( 80, 210, 130);
sc.Subgraph[SG_PREMIUM].Name = "Color - Premium Zone";
sc.Subgraph[SG_PREMIUM].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_PREMIUM].PrimaryColor = RGB(180, 60, 60);
sc.Subgraph[SG_DISCOUNT].Name = "Color - Discount Zone";
sc.Subgraph[SG_DISCOUNT].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_DISCOUNT].PrimaryColor = RGB( 60, 160, 100);
sc.Subgraph[SG_EQUILIBRIUM].Name = "Color - Equilibrium";
sc.Subgraph[SG_EQUILIBRIUM].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_EQUILIBRIUM].PrimaryColor = RGB(160, 160, 160);
sc.Subgraph[SG_OTE].Name = "Color - OTE Zone";
sc.Subgraph[SG_OTE].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_OTE].PrimaryColor = RGB(200, 180, 60);
sc.Subgraph[SG_PDHL].Name = "Color - Previous Day H/L";
sc.Subgraph[SG_PDHL].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_PDHL].PrimaryColor = RGB(190, 190, 190);
sc.Subgraph[SG_PWHL].Name = "Color - Previous Week H/L";
sc.Subgraph[SG_PWHL].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_PWHL].PrimaryColor = RGB(150, 150, 240);
sc.Subgraph[SG_PMHL].Name = "Color - Previous Month H/L";
sc.Subgraph[SG_PMHL].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_PMHL].PrimaryColor = RGB(240, 150, 240);
sc.Subgraph[SG_STRONG].Name = "Color - Strong High/Low";
sc.Subgraph[SG_STRONG].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_STRONG].PrimaryColor = RGB(255, 255, 255);
sc.Subgraph[SG_WEAK].Name = "Color - Weak High/Low";
sc.Subgraph[SG_WEAK].DrawStyle = DRAWSTYLE_IGNORE;
sc.Subgraph[SG_WEAK].PrimaryColor = RGB(140, 140, 140);
sc.Subgraph[SG_ATR].Name = "Internal ATR (hidden)";
sc.Subgraph[SG_ATR].DrawStyle = DRAWSTYLE_IGNORE;
// ---------------- inputs ----------------
sc.Input[IN_SWING_LEN].Name = "Structure: Swing (External) Pivot Length";
sc.Input[IN_SWING_LEN].SetInt(25);
sc.Input[IN_SWING_LEN].SetIntLimits(1, 500);
sc.Input[IN_INT_LEN].Name = "Structure: Internal Pivot Length";
sc.Input[IN_INT_LEN].SetInt(5);
sc.Input[IN_INT_LEN].SetIntLimits(1, 500);
sc.Input[IN_CONFIRM].Name = "Structure: Break Confirmation";
sc.Input[IN_CONFIRM].SetCustomInputStrings("Candle Close;Wick");
sc.Input[IN_CONFIRM].SetCustomInputIndex(0);
sc.Input[IN_SHOW_EXT_STRUCT].Name = "Structure: Show External BOS / CHoCH";
sc.Input[IN_SHOW_EXT_STRUCT].SetYesNo(1);
sc.Input[IN_SHOW_INT_STRUCT].Name = "Structure: Show Internal BOS / CHoCH";
sc.Input[IN_SHOW_INT_STRUCT].SetYesNo(1);
sc.Input[IN_SHOW_STRONG_WEAK].Name = "Structure: Show Strong / Weak Highs & Lows";
sc.Input[IN_SHOW_STRONG_WEAK].SetYesNo(1);
sc.Input[IN_MAX_STRUCT_LABELS].Name = "Structure: Max Structure Labels Kept";
sc.Input[IN_MAX_STRUCT_LABELS].SetInt(30);
sc.Input[IN_MAX_STRUCT_LABELS].SetIntLimits(1, 500);
sc.Input[IN_SHOW_OB].Name = "PD Arrays: Show Order Blocks";
sc.Input[IN_SHOW_OB].SetYesNo(1);
sc.Input[IN_OB_SOURCE].Name = "PD Arrays: Order Block Candle";
sc.Input[IN_OB_SOURCE].SetCustomInputStrings("Last Opposite Candle;Extreme Candle");
sc.Input[IN_OB_SOURCE].SetCustomInputIndex(0);
sc.Input[IN_ZONE_DEF].Name = "PD Arrays: Zone Definition";
sc.Input[IN_ZONE_DEF].SetCustomInputStrings("Full Candle Range;Body Only;Wick Only");
sc.Input[IN_ZONE_DEF].SetCustomInputIndex(0);
sc.Input[IN_INVALIDATION].Name = "PD Arrays: Zone Invalidation";
sc.Input[IN_INVALIDATION].SetCustomInputStrings("Candle Close;Wick");
sc.Input[IN_INVALIDATION].SetCustomInputIndex(0);
sc.Input[IN_SHOW_BRK].Name = "PD Arrays: Show Breaker Blocks";
sc.Input[IN_SHOW_BRK].SetYesNo(1);
sc.Input[IN_SHOW_MB].Name = "PD Arrays: Show Mitigation Blocks";
sc.Input[IN_SHOW_MB].SetYesNo(1);
sc.Input[IN_SHOW_RB].Name = "PD Arrays: Show Rejection Blocks";
sc.Input[IN_SHOW_RB].SetYesNo(1);
sc.Input[IN_RB_WICK_RATIO].Name = "PD Arrays: Rejection Wick Ratio (%)";
sc.Input[IN_RB_WICK_RATIO].SetFloat(60.0f);
sc.Input[IN_RB_WICK_RATIO].SetFloatLimits(10.0f, 95.0f);
sc.Input[IN_RB_MIN_WICK].Name = "PD Arrays: Rejection Min Wick (ATR x)";
sc.Input[IN_RB_MIN_WICK].SetFloat(0.75f);
sc.Input[IN_INTERNAL_OB].Name = "PD Arrays: Also Build Order Blocks From Internal Structure";
sc.Input[IN_INTERNAL_OB].SetYesNo(0);
sc.Input[IN_SHOW_FVG].Name = "Imbalance: Show Fair Value Gaps";
sc.Input[IN_SHOW_FVG].SetYesNo(1);
sc.Input[IN_FVG_MIN].Name = "Imbalance: FVG Min Size (ATR x)";
sc.Input[IN_FVG_MIN].SetFloat(0.10f);
sc.Input[IN_SHOW_GAP].Name = "Imbalance: Show Opening / Volume Gaps";
sc.Input[IN_SHOW_GAP].SetYesNo(1);
sc.Input[IN_GAP_MIN].Name = "Imbalance: Opening Gap Min Size (ATR x)";
sc.Input[IN_GAP_MIN].SetFloat(0.05f);
sc.Input[IN_SHOW_VOID].Name = "Imbalance: Show Liquidity Voids";
sc.Input[IN_SHOW_VOID].SetYesNo(1);
sc.Input[IN_VOID_MIN_BARS].Name = "Imbalance: Void Min Consecutive Bars";
sc.Input[IN_VOID_MIN_BARS].SetInt(3);
sc.Input[IN_VOID_MIN_BARS].SetIntLimits(2, 50);
sc.Input[IN_VOID_MIN_SIZE].Name = "Imbalance: Void Min Leg Size (ATR x)";
sc.Input[IN_VOID_MIN_SIZE].SetFloat(2.0f);
sc.Input[IN_FILL_METHOD].Name = "Imbalance: Fill / Invalidate Method";
sc.Input[IN_FILL_METHOD].SetCustomInputStrings("Wick Touch;Candle Close");
sc.Input[IN_FILL_METHOD].SetCustomInputIndex(0);
sc.Input[IN_SHOW_EQ].Name = "Liquidity: Show Equal Highs / Lows";
sc.Input[IN_SHOW_EQ].SetYesNo(1);
sc.Input[IN_EQ_LEN].Name = "Liquidity: EQH / EQL Pivot Length";
sc.Input[IN_EQ_LEN].SetInt(3);
sc.Input[IN_EQ_LEN].SetIntLimits(1, 100);
sc.Input[IN_EQ_TOL].Name = "Liquidity: EQH / EQL Tolerance (ATR x)";
sc.Input[IN_EQ_TOL].SetFloat(0.10f);
sc.Input[IN_EQ_MAXBARS].Name = "Liquidity: EQH / EQL Max Bars Between";
sc.Input[IN_EQ_MAXBARS].SetInt(100);
sc.Input[IN_EQ_MAXBARS].SetIntLimits(2, 5000);
sc.Input[IN_SHOW_SWEEP].Name = "Liquidity: Show Sweeps / Stop Hunts";
sc.Input[IN_SHOW_SWEEP].SetYesNo(1);
sc.Input[IN_SWEEP_PEN].Name = "Liquidity: Sweep Min Penetration (ATR x)";
sc.Input[IN_SWEEP_PEN].SetFloat(0.0f);
sc.Input[IN_MAX_LIQ].Name = "Liquidity: Max EQH / EQL Levels Kept";
sc.Input[IN_MAX_LIQ].SetInt(20);
sc.Input[IN_MAX_LIQ].SetIntLimits(1, 200);
sc.Input[IN_SHOW_PD].Name = "Levels: Show Premium / Discount / Equilibrium";
sc.Input[IN_SHOW_PD].SetYesNo(1);
sc.Input[IN_SHOW_OTE].Name = "Levels: Show OTE Band (0.62 - 0.79)";
sc.Input[IN_SHOW_OTE].SetYesNo(1);
sc.Input[IN_SHOW_PDAY].Name = "Levels: Show Previous Day High / Low";
sc.Input[IN_SHOW_PDAY].SetYesNo(1);
sc.Input[IN_SHOW_PWEEK].Name = "Levels: Show Previous Week High / Low";
sc.Input[IN_SHOW_PWEEK].SetYesNo(1);
sc.Input[IN_SHOW_PMONTH].Name = "Levels: Show Previous Month High / Low";
sc.Input[IN_SHOW_PMONTH].SetYesNo(0);
sc.Input[IN_ATR_LEN].Name = "Display: ATR Length (sizing filters)";
sc.Input[IN_ATR_LEN].SetInt(200);
sc.Input[IN_ATR_LEN].SetIntLimits(2, 2000);
sc.Input[IN_ZONE_EXTEND].Name = "Display: Zone Right Extension (bars)";
sc.Input[IN_ZONE_EXTEND].SetInt(12);
sc.Input[IN_ZONE_EXTEND].SetIntLimits(0, 500);
sc.Input[IN_TRANSPARENCY].Name = "Display: Zone Transparency (0-100)";
sc.Input[IN_TRANSPARENCY].SetInt(78);
sc.Input[IN_TRANSPARENCY].SetIntLimits(0, 100);
sc.Input[IN_MAX_ZONES].Name = "Display: Max Zones Per Type";
sc.Input[IN_MAX_ZONES].SetInt(8);
sc.Input[IN_MAX_ZONES].SetIntLimits(1, 100);
sc.Input[IN_FONT_SIZE].Name = "Display: Label Font Size";
sc.Input[IN_FONT_SIZE].SetInt(8);
sc.Input[IN_FONT_SIZE].SetIntLimits(4, 40);
sc.Input[IN_SHOW_LABELS].Name = "Display: Show Text Labels";
sc.Input[IN_SHOW_LABELS].SetYesNo(1);
sc.Input[IN_DELETE_INVALID].Name = "Display: Delete Invalidated Zones";
sc.Input[IN_DELETE_INVALID].SetYesNo(1);
sc.Input[IN_ALERTS_ON].Name = "Alerts: Master Enable";
sc.Input[IN_ALERTS_ON].SetYesNo(1);
sc.Input[IN_ALERT_SOUND].Name = "Alerts: Sound Number (0 = log only)";
sc.Input[IN_ALERT_SOUND].SetInt(1);
sc.Input[IN_ALERT_SOUND].SetIntLimits(0, 100);
sc.Input[IN_ALERT_INTRABAR].Name = "Alerts: Allow Intrabar (Unconfirmed) Alerts";
sc.Input[IN_ALERT_INTRABAR].SetYesNo(0);
sc.Input[IN_AL_EXT_BOS].Name = "Alert: External BOS";
sc.Input[IN_AL_EXT_BOS].SetYesNo(1);
sc.Input[IN_AL_EXT_CHOCH].Name = "Alert: External CHoCH / MSS";
sc.Input[IN_AL_EXT_CHOCH].SetYesNo(1);
sc.Input[IN_AL_INT_BOS].Name = "Alert: Internal BOS";
sc.Input[IN_AL_INT_BOS].SetYesNo(0);
sc.Input[IN_AL_INT_CHOCH].Name = "Alert: Internal CHoCH";
sc.Input[IN_AL_INT_CHOCH].SetYesNo(1);
sc.Input[IN_AL_NEW_OB].Name = "Alert: New Order Block";
sc.Input[IN_AL_NEW_OB].SetYesNo(1);
sc.Input[IN_AL_OB_TAP].Name = "Alert: Zone Tap / Mitigation Entry";
sc.Input[IN_AL_OB_TAP].SetYesNo(1);
sc.Input[IN_AL_OB_INVALID].Name = "Alert: Zone Invalidated";
sc.Input[IN_AL_OB_INVALID].SetYesNo(0);
sc.Input[IN_AL_BRK].Name = "Alert: Breaker Block Formed";
sc.Input[IN_AL_BRK].SetYesNo(1);
sc.Input[IN_AL_MB].Name = "Alert: Mitigation Block Formed";
sc.Input[IN_AL_MB].SetYesNo(1);
sc.Input[IN_AL_RB].Name = "Alert: Rejection Block Formed";
sc.Input[IN_AL_RB].SetYesNo(0);
sc.Input[IN_AL_FVG_NEW].Name = "Alert: New Fair Value Gap";
sc.Input[IN_AL_FVG_NEW].SetYesNo(0);
sc.Input[IN_AL_FVG_FILL].Name = "Alert: Fair Value Gap Filled";
sc.Input[IN_AL_FVG_FILL].SetYesNo(0);
sc.Input[IN_AL_GAP].Name = "Alert: New Opening / Volume Gap";
sc.Input[IN_AL_GAP].SetYesNo(0);
sc.Input[IN_AL_VOID].Name = "Alert: New Liquidity Void";
sc.Input[IN_AL_VOID].SetYesNo(0);
sc.Input[IN_AL_EQ].Name = "Alert: Equal Highs / Lows Formed";
sc.Input[IN_AL_EQ].SetYesNo(1);
sc.Input[IN_AL_SWEEP].Name = "Alert: Liquidity Sweep / Stop Hunt";
sc.Input[IN_AL_SWEEP].SetYesNo(1);
sc.Input[IN_AL_PD].Name = "Alert: Premium / Discount Entry";
sc.Input[IN_AL_PD].SetYesNo(0);
sc.Input[IN_AL_HTF].Name = "Alert: Previous Day/Week/Month Level Taken";
sc.Input[IN_AL_HTF].SetYesNo(1);
return;
}
//--------------------------------------------------------------------------
// Persistent state
//--------------------------------------------------------------------------
s_SMCState* S = (s_SMCState*)sc.GetPersistentPointer(0);
if (sc.LastCallToFunction)
{
if (S != NULL)
{
delete S;
sc.SetPersistentPointer(0, NULL);
}
return;
}
if (S == NULL)
{
S = new s_SMCState();
if (S == NULL)
return;
sc.SetPersistentPointer(0, S);
SMC_ResetState(*S);
}
if (sc.ArraySize < 10)
return;
//--------------------------------------------------------------------------
// Read inputs
//--------------------------------------------------------------------------
const int SwingLen = SMC_MaxI(1, sc.Input[IN_SWING_LEN].GetInt());
const int IntLen = SMC_MaxI(1, sc.Input[IN_INT_LEN].GetInt());
const bool ConfirmWick = (sc.Input[IN_CONFIRM].GetIndex() == 1);
const bool ShowExt = sc.Input[IN_SHOW_EXT_STRUCT].GetYesNo() != 0;
const bool ShowInt = sc.Input[IN_SHOW_INT_STRUCT].GetYesNo() != 0;
const bool ShowStrongWeak= sc.Input[IN_SHOW_STRONG_WEAK].GetYesNo() != 0;
const int MaxStructLbl = SMC_MaxI(1, sc.Input[IN_MAX_STRUCT_LABELS].GetInt());
const bool ShowOB = sc.Input[IN_SHOW_OB].GetYesNo() != 0;
const int OBSource = sc.Input[IN_OB_SOURCE].GetIndex();
const int ZoneDef = sc.Input[IN_ZONE_DEF].GetIndex();
const bool InvalidWick = (sc.Input[IN_INVALIDATION].GetIndex() == 1);
const bool ShowBrk = sc.Input[IN_SHOW_BRK].GetYesNo() != 0;
const bool ShowMB = sc.Input[IN_SHOW_MB].GetYesNo() != 0;
const bool ShowRB = sc.Input[IN_SHOW_RB].GetYesNo() != 0;
const float RBWickRatio = sc.Input[IN_RB_WICK_RATIO].GetFloat() / 100.0f;
const float RBMinWick = sc.Input[IN_RB_MIN_WICK].GetFloat();
const bool InternalOB = sc.Input[IN_INTERNAL_OB].GetYesNo() != 0;
const bool ShowFVG = sc.Input[IN_SHOW_FVG].GetYesNo() != 0;
const float FVGMin = sc.Input[IN_FVG_MIN].GetFloat();
const bool ShowGap = sc.Input[IN_SHOW_GAP].GetYesNo() != 0;
const float GapMin = sc.Input[IN_GAP_MIN].GetFloat();
const bool ShowVoid = sc.Input[IN_SHOW_VOID].GetYesNo() != 0;
const int VoidMinBars = SMC_MaxI(2, sc.Input[IN_VOID_MIN_BARS].GetInt());
const float VoidMinSize = sc.Input[IN_VOID_MIN_SIZE].GetFloat();
const bool FillOnClose = (sc.Input[IN_FILL_METHOD].GetIndex() == 1);
const bool ShowEQ = sc.Input[IN_SHOW_EQ].GetYesNo() != 0;
const int EqLen = SMC_MaxI(1, sc.Input[IN_EQ_LEN].GetInt());
const float EqTol = sc.Input[IN_EQ_TOL].GetFloat();
const int EqMaxBars = SMC_MaxI(2, sc.Input[IN_EQ_MAXBARS].GetInt());