forked from gitclonparis/ninpai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVAB20092024V2.cs
548 lines (453 loc) · 31.7 KB
/
VAB20092024V2.cs
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
#region Using declarations
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Gui;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Gui.SuperDom;
using NinjaTrader.Gui.Tools;
using NinjaTrader.Data;
using NinjaTrader.NinjaScript;
using NinjaTrader.Core.FloatingPoint;
using NinjaTrader.NinjaScript.DrawingTools;
#endregion
namespace NinjaTrader.NinjaScript.Indicators.ninpai
{
public class VAB20092024V2 : Indicator
{
private double sumPriceVolume;
private double sumVolume;
private double sumSquaredPriceVolume;
private DateTime lastResetTime;
private int barsSinceReset;
private int upperBreakoutCount;
private int lowerBreakoutCount;
private ADX ADX1;
private ATR ATR1;
private VOL VOL1;
private VOLMA VOLMA1;
// New Parameters for Slope Filter (updated)
[Display(Name = "Enable Slope Filter UP", Order = 1, GroupName = "Slope Filter UP")]
public bool EnableSlopeFilterUP { get; set; }
[Display(Name = "Minimum Slope Value UP", Order = 2, GroupName = "Slope Filter UP")]
public double MinSlopeValueUP { get; set; }
[Display(Name = "Slope Bars Count UP", Order = 3, GroupName = "Slope Filter UP")]
public int SlopeBarsCountUP { get; set; }
[Display(Name = "Enable Slope Filter DOWN", Order = 1, GroupName = "Slope Filter DOWN")]
public bool EnableSlopeFilterDOWN { get; set; }
[Display(Name = "Minimum Slope Value DOWN", Order = 2, GroupName = "Slope Filter DOWN")]
public double MinSlopeValueDOWN { get; set; }
[Display(Name = "Slope Bars Count DOWN", Order = 3, GroupName = "Slope Filter DOWN")]
public int SlopeBarsCountDOWN { get; set; }
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Indicateur BVA-Limusine combiné";
Name = "VAB20092024V2";
Calculate = Calculate.OnEachTick;
IsOverlay = true;
DisplayInDataBox = true;
DrawOnPricePanel = true;
DrawHorizontalGridLines = true;
DrawVerticalGridLines = true;
PaintPriceMarkers = true;
ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
IsSuspendedWhileInactive = true;
// Paramètres BVA
ResetPeriod = 120;
MinBarsForSignal = 10;
MaxBarsForSignal = 100;
MinEntryDistanceUP = 3;
MaxEntryDistanceUP = 40;
MaxUpperBreakouts = 3;
MinEntryDistanceDOWN = 3;
MaxEntryDistanceDOWN = 40;
MaxLowerBreakouts = 3;
FminADX = 0;
FmaxADX = 0;
FminATR = 0;
FmaxATR = 0;
FperiodVol = 9;
// Paramètres Limusine
MinimumTicks = 10;
MaximumTicks = 30;
ShowLimusineOpenCloseUP = true;
ShowLimusineOpenCloseDOWN = true;
ShowLimusineHighLowUP = true;
ShowLimusineHighLowDOWN = true;
// New Slope Filter Parameters
EnableSlopeFilterUP = false;
MinSlopeValueUP = 0.0; // Minimum slope value (price units per bar)
SlopeBarsCountUP = 5;
EnableSlopeFilterDOWN = false;
MinSlopeValueDOWN = 0.0; // Minimum slope value (price units per bar)
SlopeBarsCountDOWN = 5;
AddPlot(Brushes.Orange, "VWAP");
AddPlot(Brushes.Red, "StdDev1Upper");
AddPlot(Brushes.Red, "StdDev1Lower");
AddPlot(Brushes.Green, "StdDev2Upper");
AddPlot(Brushes.Green, "StdDev2Lower");
AddPlot(Brushes.Blue, "StdDev3Upper");
AddPlot(Brushes.Blue, "StdDev3Lower");
}
else if (State == State.Configure)
{
AddDataSeries(Data.BarsPeriodType.Tick, 1);
ResetValues(DateTime.MinValue);
}
else if (State == State.DataLoaded)
{
ADX1 = ADX(Close, 14);
ATR1 = ATR(Close, 14);
VOL1 = VOL(Close);
VOLMA1 = VOLMA(Close, Convert.ToInt32(FperiodVol));
}
}
protected override void OnBarUpdate()
{
int requiredBars = 20;
if (EnableSlopeFilterUP)
requiredBars = Math.Max(requiredBars, SlopeBarsCountUP);
if (EnableSlopeFilterDOWN)
requiredBars = Math.Max(requiredBars, SlopeBarsCountDOWN);
if (CurrentBars[0] < requiredBars)
return;
DateTime currentBarTime = Time[0];
if (Bars.IsFirstBarOfSession)
{
ResetValues(currentBarTime);
}
else if (lastResetTime != DateTime.MinValue && (currentBarTime - lastResetTime).TotalMinutes >= ResetPeriod)
{
ResetValues(currentBarTime);
}
if (BarsInProgress == 1)
{
OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0).Update(
OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Bar, 0).BarsArray[1].Count - 1, 1);
OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).Update(
OrderFlowCumulativeDelta(BarsArray[0], CumulativeDeltaType.BidAsk, CumulativeDeltaPeriod.Session, 0).BarsArray[1].Count - 1, 1);
return;
}
// Calcul VWAP et écarts-types
double typicalPrice = (High[0] + Low[0] + Close[0]) / 3;
double volume = Volume[0];
sumPriceVolume += typicalPrice * volume;
sumVolume += volume;
sumSquaredPriceVolume += typicalPrice * typicalPrice * volume;
double vwap = sumPriceVolume / sumVolume;
double variance = (sumSquaredPriceVolume / sumVolume) - (vwap * vwap);
double stdDev = Math.Sqrt(variance);
Values[0][0] = vwap;
Values[1][0] = vwap + stdDev;
Values[2][0] = vwap - stdDev;
Values[3][0] = vwap + 2 * stdDev;
Values[4][0] = vwap - 2 * stdDev;
Values[5][0] = vwap + 3 * stdDev;
Values[6][0] = vwap - 3 * stdDev;
barsSinceReset++;
// Vérification des conditions combinées
if (ShouldDrawUpArrow())
{
Draw.ArrowUp(this, "UpArrow" + CurrentBar, true, 0, Low[0] - 2 * TickSize, Brushes.Green);
upperBreakoutCount++;
// Calcul de la distance entre VWAP et StdDev1 Lower (StdDev-1)
double distanceRed = Values[0][0] - Values[2][0]; // VWAP - StdDev1 Lower
double priceForRedDot = Close[0] - distanceRed;
// Dessiner le point rouge
Draw.Dot(this, "RedDotUp" + CurrentBar, true, 0, priceForRedDot, Brushes.Red);
// Calcul de la distance pour le point bleu (comme précédemment)
double distanceBlue = Values[1][0] - Values[0][0]; // StdDev1 Upper - VWAP
double priceForBlueDot = Close[0] + distanceBlue;
// Dessiner le point bleu
Draw.Dot(this, "BlueDotUp" + CurrentBar, true, 0, priceForBlueDot, Brushes.Blue);
// Dessiner le point blanc au prix actuel
Draw.Dot(this, "WhiteDotUp" + CurrentBar, true, 0, Close[0], Brushes.White);
}
else if (ShouldDrawDownArrow())
{
Draw.ArrowDown(this, "DownArrow" + CurrentBar, true, 0, High[0] + 2 * TickSize, Brushes.Red);
lowerBreakoutCount++;
// Calcul de la distance entre StdDev1 Upper (StdDev+1) et VWAP
double distanceRed = Values[1][0] - Values[0][0]; // StdDev1 Upper - VWAP
double priceForRedDot = Close[0] + distanceRed;
// Dessiner le point rouge
Draw.Dot(this, "RedDotDown" + CurrentBar, true, 0, priceForRedDot, Brushes.Red);
// Calcul de la distance pour le point bleu (comme précédemment)
double distanceBlue = Values[0][0] - Values[2][0]; // VWAP - StdDev1 Lower
double priceForBlueDot = Close[0] - distanceBlue;
// Dessiner le point bleu
Draw.Dot(this, "BlueDotDown" + CurrentBar, true, 0, priceForBlueDot, Brushes.Blue);
// Dessiner le point blanc au prix actuel
Draw.Dot(this, "WhiteDotDown" + CurrentBar, true, 0, Close[0], Brushes.White);
}
}
private bool ShouldDrawUpArrow()
{
bool bvaCondition = (Close[0] > Open[0]) &&
(!OKisADX || (ADX1[0] > FminADX && ADX1[0] < FmaxADX)) &&
(!OKisATR || (ATR1[0] > FminATR && ATR1[0] < FmaxATR)) &&
(!OKisVOL || (VOL1[0] > VOLMA1[0])) &&
(!OKisAfterBarsSinceResetUP || (barsSinceReset > MinBarsForSignal && barsSinceReset < MaxBarsForSignal)) &&
(!OKisAboveUpperThreshold || Close[0] > (Values[1][0] + MinEntryDistanceUP * TickSize)) &&
(!OKisWithinMaxEntryDistance || Close[0] <= (Values[1][0] + MaxEntryDistanceUP * TickSize)) &&
(!OKisUpperBreakoutCountExceeded || upperBreakoutCount < MaxUpperBreakouts);
double openCloseDiff = Math.Abs(Open[0] - Close[0]) / TickSize;
double highLowDiff = Math.Abs(High[0] - Low[0]) / TickSize;
bool limusineCondition = (ShowLimusineOpenCloseUP && openCloseDiff >= MinimumTicks && openCloseDiff <= MaximumTicks && Close[0] > Open[0]) ||
(ShowLimusineHighLowUP && highLowDiff >= MinimumTicks && highLowDiff <= MaximumTicks && Close[0] > Open[0]);
// New Slope Condition for UP Arrows
if (EnableSlopeFilterUP)
{
if (CurrentBar < SlopeBarsCountUP)
return false; // Not enough bars to calculate slope
double oldValue = Values[5][SlopeBarsCountUP - 1]; // StdDev3Upper value SlopeBarsCountUP bars ago
double newValue = Values[5][0]; // Current StdDev3Upper value
double slopePerBar = (newValue - oldValue) / SlopeBarsCountUP;
if (slopePerBar < MinSlopeValueUP)
return false; // The slope is not steep enough upwards
}
return bvaCondition && limusineCondition;
}
private bool ShouldDrawDownArrow()
{
bool bvaCondition = (Close[0] < Open[0]) &&
(!OKisADX || (ADX1[0] > FminADX && ADX1[0] < FmaxADX)) &&
(!OKisATR || (ATR1[0] > FminATR && ATR1[0] < FmaxATR)) &&
(!OKisVOL || (VOL1[0] > VOLMA1[0])) &&
(!OKisAfterBarsSinceResetDown || (barsSinceReset > MinBarsForSignal && barsSinceReset < MaxBarsForSignal)) &&
(!OKisBelovLowerThreshold || Close[0] < (Values[2][0] - MinEntryDistanceDOWN * TickSize)) &&
(!OKisWithinMaxEntryDistanceDown || Close[0] >= (Values[2][0] - MaxEntryDistanceDOWN * TickSize)) &&
(!OKisLowerBreakoutCountExceeded || lowerBreakoutCount < MaxLowerBreakouts);
double openCloseDiff = Math.Abs(Open[0] - Close[0]) / TickSize;
double highLowDiff = Math.Abs(High[0] - Low[0]) / TickSize;
bool limusineCondition = (ShowLimusineOpenCloseDOWN && openCloseDiff >= MinimumTicks && openCloseDiff <= MaximumTicks && Close[0] < Open[0]) ||
(ShowLimusineHighLowDOWN && highLowDiff >= MinimumTicks && highLowDiff <= MaximumTicks && Close[0] < Open[0]);
// New Slope Condition for DOWN Arrows
if (EnableSlopeFilterDOWN)
{
if (CurrentBar < SlopeBarsCountDOWN)
return false; // Not enough bars to calculate slope
double oldValue = Values[6][SlopeBarsCountDOWN - 1]; // StdDev3Lower value SlopeBarsCountDOWN bars ago
double newValue = Values[6][0]; // Current StdDev3Lower value
double slopePerBar = (newValue - oldValue) / SlopeBarsCountDOWN;
if (slopePerBar > -MinSlopeValueDOWN)
return false; // The slope is not steep enough downwards
}
return bvaCondition && limusineCondition;
}
private void ResetValues(DateTime resetTime)
{
sumPriceVolume = 0;
sumVolume = 0;
sumSquaredPriceVolume = 0;
barsSinceReset = 0;
upperBreakoutCount = 0;
lowerBreakoutCount = 0;
lastResetTime = resetTime;
}
#region Properties
// Propriétés BVA
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Reset Period (Minutes)", Order = 1, GroupName = "BVA Parameters")]
public int ResetPeriod { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Min Bars for Signal", Order = 2, GroupName = "BVA Parameters")]
public int MinBarsForSignal { get; set; }
[Range(1, int.MaxValue)]
[Display(Name = "Max Bars for Signal", Description = "Nombre maximum de barres depuis la réinitialisation pour un signal", Order = 3, GroupName = "BVA Parameters")]
public int MaxBarsForSignal
{ get; set; }
// ############ Buy #############
// Buy
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Min Entry Distance UP", Order = 1, GroupName = "Buy")]
public int MinEntryDistanceUP { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Max Entry Distance UP", Order = 2, GroupName = "Buy")]
public int MaxEntryDistanceUP { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Max Upper Breakouts", Order = 3, GroupName = "Buy")]
public int MaxUpperBreakouts { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisAfterBarsSinceResetUP", Description = "Check Bars Since Reset UP", Order = 1, GroupName = "Buy")]
public bool OKisAfterBarsSinceResetUP { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisAboveUpperThreshold", Description = "Check Above Upper Threshold", Order = 1, GroupName = "Buy")]
public bool OKisAboveUpperThreshold { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisWithinMaxEntryDistance", Description = "Check Within Max Entry Distance", Order = 1, GroupName = "Buy")]
public bool OKisWithinMaxEntryDistance { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisUpperBreakoutCountExceeded", Description = "Check Upper Breakout Count Exceeded", Order = 1, GroupName = "Buy")]
public bool OKisUpperBreakoutCountExceeded { get; set; }
// ############ Sell #############
// Sell
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Min Entry Distance DOWN", Order = 1, GroupName = "Sell")]
public int MinEntryDistanceDOWN { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Max Entry Distance DOWN", Order = 2, GroupName = "Sell")]
public int MaxEntryDistanceDOWN { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Max Lower Breakouts", Order = 3, GroupName = "Sell")]
public int MaxLowerBreakouts { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisAfterBarsSinceResetDown", Description = "Check Bars Since Reset Down", Order = 1, GroupName = "Sell")]
public bool OKisAfterBarsSinceResetDown { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisBelovLowerThreshold", Description = "Check Below Lower Threshold", Order = 1, GroupName = "Sell")]
public bool OKisBelovLowerThreshold { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisWithinMaxEntryDistanceDown", Description = "Check Within Max Entry Distance Down", Order = 1, GroupName = "Sell")]
public bool OKisWithinMaxEntryDistanceDown { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisLowerBreakoutCountExceeded", Description = "Check Lower Breakout Count Exceeded", Order = 1, GroupName = "Sell")]
public bool OKisLowerBreakoutCountExceeded { get; set; }
// ############ ADX #############
// ADX
[NinjaScriptProperty]
[Range(0, double.MaxValue)]
[Display(Name = "Fmin ADX", Order = 1, GroupName = "ADX")]
public double FminADX { get; set; }
[NinjaScriptProperty]
[Range(0, double.MaxValue)]
[Display(Name = "Fmax ADX", Order = 2, GroupName = "ADX")]
public double FmaxADX { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisADX", Description = "Check ADX", Order = 1, GroupName = "ADX")]
public bool OKisADX { get; set; }
// ############ ATR #############
// ATR
[NinjaScriptProperty]
[Range(0, double.MaxValue)]
[Display(Name = "Fmin ATR", Order = 1, GroupName = "ATR")]
public double FminATR { get; set; }
[NinjaScriptProperty]
[Range(0, double.MaxValue)]
[Display(Name = "Fmax ATR", Order = 2, GroupName = "ATR")]
public double FmaxATR { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisATR", Description = "Check ATR", Order = 1, GroupName = "ATR")]
public bool OKisATR { get; set; }
// ############ Volume #############
// Volume
[NinjaScriptProperty]
[Range(0, int.MaxValue)]
[Display(Name = "Fperiod Vol", Order = 1, GroupName = "Volume")]
public int FperiodVol { get; set; }
[NinjaScriptProperty]
[Range(0, 1)]
[Display(Name = "OKisVOL", Description = "Check Volume", Order = 1, GroupName = "Volume")]
public bool OKisVOL { get; set; }
// Propriétés Limusine
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Minimum Ticks", Description = "Nombre minimum de ticks pour une limusine", Order = 1, GroupName = "Limusine Parameters")]
public int MinimumTicks { get; set; }
[NinjaScriptProperty]
[Range(1, int.MaxValue)]
[Display(Name = "Maximum Ticks", Description = "Nombre maximum de ticks pour une limusine", Order = 2, GroupName = "Limusine Parameters")]
public int MaximumTicks { get; set; }
[NinjaScriptProperty]
[Display(Name = "Afficher Limusine Open-Close UP", Description = "Afficher les limusines Open-Close UP", Order = 3, GroupName = "Limusine Parameters")]
public bool ShowLimusineOpenCloseUP { get; set; }
[NinjaScriptProperty]
[Display(Name = "Afficher Limusine Open-Close DOWN", Description = "Afficher les limusines Open-Close DOWN", Order = 4, GroupName = "Limusine Parameters")]
public bool ShowLimusineOpenCloseDOWN { get; set; }
[NinjaScriptProperty]
[Display(Name = "Afficher Limusine High-Low UP", Description = "Afficher les limusines High-Low UP", Order = 5, GroupName = "Limusine Parameters")]
public bool ShowLimusineHighLowUP { get; set; }
[NinjaScriptProperty]
[Display(Name = "Afficher Limusine High-Low DOWN", Description = "Afficher les limusines High-Low DOWN", Order = 6, GroupName = "Limusine Parameters")]
public bool ShowLimusineHighLowDOWN { get; set; }
// ... (autres propriétés)
[Browsable(false)]
[XmlIgnore]
public Series<double> VWAP => Values[0];
[Browsable(false)]
[XmlIgnore]
public Series<double> StdDev1Upper => Values[1];
[Browsable(false)]
[XmlIgnore]
public Series<double> StdDev1Lower => Values[2];
#endregion
}
}
#region NinjaScript generated code. Neither change nor remove.
namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private ninpai.VAB20092024V2[] cacheVAB20092024V2;
public ninpai.VAB20092024V2 VAB20092024V2(int resetPeriod, int minBarsForSignal, int minEntryDistanceUP, int maxEntryDistanceUP, int maxUpperBreakouts, bool oKisAfterBarsSinceResetUP, bool oKisAboveUpperThreshold, bool oKisWithinMaxEntryDistance, bool oKisUpperBreakoutCountExceeded, int minEntryDistanceDOWN, int maxEntryDistanceDOWN, int maxLowerBreakouts, bool oKisAfterBarsSinceResetDown, bool oKisBelovLowerThreshold, bool oKisWithinMaxEntryDistanceDown, bool oKisLowerBreakoutCountExceeded, double fminADX, double fmaxADX, bool oKisADX, double fminATR, double fmaxATR, bool oKisATR, int fperiodVol, bool oKisVOL, int minimumTicks, int maximumTicks, bool showLimusineOpenCloseUP, bool showLimusineOpenCloseDOWN, bool showLimusineHighLowUP, bool showLimusineHighLowDOWN)
{
return VAB20092024V2(Input, resetPeriod, minBarsForSignal, minEntryDistanceUP, maxEntryDistanceUP, maxUpperBreakouts, oKisAfterBarsSinceResetUP, oKisAboveUpperThreshold, oKisWithinMaxEntryDistance, oKisUpperBreakoutCountExceeded, minEntryDistanceDOWN, maxEntryDistanceDOWN, maxLowerBreakouts, oKisAfterBarsSinceResetDown, oKisBelovLowerThreshold, oKisWithinMaxEntryDistanceDown, oKisLowerBreakoutCountExceeded, fminADX, fmaxADX, oKisADX, fminATR, fmaxATR, oKisATR, fperiodVol, oKisVOL, minimumTicks, maximumTicks, showLimusineOpenCloseUP, showLimusineOpenCloseDOWN, showLimusineHighLowUP, showLimusineHighLowDOWN);
}
public ninpai.VAB20092024V2 VAB20092024V2(ISeries<double> input, int resetPeriod, int minBarsForSignal, int minEntryDistanceUP, int maxEntryDistanceUP, int maxUpperBreakouts, bool oKisAfterBarsSinceResetUP, bool oKisAboveUpperThreshold, bool oKisWithinMaxEntryDistance, bool oKisUpperBreakoutCountExceeded, int minEntryDistanceDOWN, int maxEntryDistanceDOWN, int maxLowerBreakouts, bool oKisAfterBarsSinceResetDown, bool oKisBelovLowerThreshold, bool oKisWithinMaxEntryDistanceDown, bool oKisLowerBreakoutCountExceeded, double fminADX, double fmaxADX, bool oKisADX, double fminATR, double fmaxATR, bool oKisATR, int fperiodVol, bool oKisVOL, int minimumTicks, int maximumTicks, bool showLimusineOpenCloseUP, bool showLimusineOpenCloseDOWN, bool showLimusineHighLowUP, bool showLimusineHighLowDOWN)
{
if (cacheVAB20092024V2 != null)
for (int idx = 0; idx < cacheVAB20092024V2.Length; idx++)
if (cacheVAB20092024V2[idx] != null && cacheVAB20092024V2[idx].ResetPeriod == resetPeriod && cacheVAB20092024V2[idx].MinBarsForSignal == minBarsForSignal && cacheVAB20092024V2[idx].MinEntryDistanceUP == minEntryDistanceUP && cacheVAB20092024V2[idx].MaxEntryDistanceUP == maxEntryDistanceUP && cacheVAB20092024V2[idx].MaxUpperBreakouts == maxUpperBreakouts && cacheVAB20092024V2[idx].OKisAfterBarsSinceResetUP == oKisAfterBarsSinceResetUP && cacheVAB20092024V2[idx].OKisAboveUpperThreshold == oKisAboveUpperThreshold && cacheVAB20092024V2[idx].OKisWithinMaxEntryDistance == oKisWithinMaxEntryDistance && cacheVAB20092024V2[idx].OKisUpperBreakoutCountExceeded == oKisUpperBreakoutCountExceeded && cacheVAB20092024V2[idx].MinEntryDistanceDOWN == minEntryDistanceDOWN && cacheVAB20092024V2[idx].MaxEntryDistanceDOWN == maxEntryDistanceDOWN && cacheVAB20092024V2[idx].MaxLowerBreakouts == maxLowerBreakouts && cacheVAB20092024V2[idx].OKisAfterBarsSinceResetDown == oKisAfterBarsSinceResetDown && cacheVAB20092024V2[idx].OKisBelovLowerThreshold == oKisBelovLowerThreshold && cacheVAB20092024V2[idx].OKisWithinMaxEntryDistanceDown == oKisWithinMaxEntryDistanceDown && cacheVAB20092024V2[idx].OKisLowerBreakoutCountExceeded == oKisLowerBreakoutCountExceeded && cacheVAB20092024V2[idx].FminADX == fminADX && cacheVAB20092024V2[idx].FmaxADX == fmaxADX && cacheVAB20092024V2[idx].OKisADX == oKisADX && cacheVAB20092024V2[idx].FminATR == fminATR && cacheVAB20092024V2[idx].FmaxATR == fmaxATR && cacheVAB20092024V2[idx].OKisATR == oKisATR && cacheVAB20092024V2[idx].FperiodVol == fperiodVol && cacheVAB20092024V2[idx].OKisVOL == oKisVOL && cacheVAB20092024V2[idx].MinimumTicks == minimumTicks && cacheVAB20092024V2[idx].MaximumTicks == maximumTicks && cacheVAB20092024V2[idx].ShowLimusineOpenCloseUP == showLimusineOpenCloseUP && cacheVAB20092024V2[idx].ShowLimusineOpenCloseDOWN == showLimusineOpenCloseDOWN && cacheVAB20092024V2[idx].ShowLimusineHighLowUP == showLimusineHighLowUP && cacheVAB20092024V2[idx].ShowLimusineHighLowDOWN == showLimusineHighLowDOWN && cacheVAB20092024V2[idx].EqualsInput(input))
return cacheVAB20092024V2[idx];
return CacheIndicator<ninpai.VAB20092024V2>(new ninpai.VAB20092024V2(){ ResetPeriod = resetPeriod, MinBarsForSignal = minBarsForSignal, MinEntryDistanceUP = minEntryDistanceUP, MaxEntryDistanceUP = maxEntryDistanceUP, MaxUpperBreakouts = maxUpperBreakouts, OKisAfterBarsSinceResetUP = oKisAfterBarsSinceResetUP, OKisAboveUpperThreshold = oKisAboveUpperThreshold, OKisWithinMaxEntryDistance = oKisWithinMaxEntryDistance, OKisUpperBreakoutCountExceeded = oKisUpperBreakoutCountExceeded, MinEntryDistanceDOWN = minEntryDistanceDOWN, MaxEntryDistanceDOWN = maxEntryDistanceDOWN, MaxLowerBreakouts = maxLowerBreakouts, OKisAfterBarsSinceResetDown = oKisAfterBarsSinceResetDown, OKisBelovLowerThreshold = oKisBelovLowerThreshold, OKisWithinMaxEntryDistanceDown = oKisWithinMaxEntryDistanceDown, OKisLowerBreakoutCountExceeded = oKisLowerBreakoutCountExceeded, FminADX = fminADX, FmaxADX = fmaxADX, OKisADX = oKisADX, FminATR = fminATR, FmaxATR = fmaxATR, OKisATR = oKisATR, FperiodVol = fperiodVol, OKisVOL = oKisVOL, MinimumTicks = minimumTicks, MaximumTicks = maximumTicks, ShowLimusineOpenCloseUP = showLimusineOpenCloseUP, ShowLimusineOpenCloseDOWN = showLimusineOpenCloseDOWN, ShowLimusineHighLowUP = showLimusineHighLowUP, ShowLimusineHighLowDOWN = showLimusineHighLowDOWN }, input, ref cacheVAB20092024V2);
}
}
}
namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
{
public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
{
public Indicators.ninpai.VAB20092024V2 VAB20092024V2(int resetPeriod, int minBarsForSignal, int minEntryDistanceUP, int maxEntryDistanceUP, int maxUpperBreakouts, bool oKisAfterBarsSinceResetUP, bool oKisAboveUpperThreshold, bool oKisWithinMaxEntryDistance, bool oKisUpperBreakoutCountExceeded, int minEntryDistanceDOWN, int maxEntryDistanceDOWN, int maxLowerBreakouts, bool oKisAfterBarsSinceResetDown, bool oKisBelovLowerThreshold, bool oKisWithinMaxEntryDistanceDown, bool oKisLowerBreakoutCountExceeded, double fminADX, double fmaxADX, bool oKisADX, double fminATR, double fmaxATR, bool oKisATR, int fperiodVol, bool oKisVOL, int minimumTicks, int maximumTicks, bool showLimusineOpenCloseUP, bool showLimusineOpenCloseDOWN, bool showLimusineHighLowUP, bool showLimusineHighLowDOWN)
{
return indicator.VAB20092024V2(Input, resetPeriod, minBarsForSignal, minEntryDistanceUP, maxEntryDistanceUP, maxUpperBreakouts, oKisAfterBarsSinceResetUP, oKisAboveUpperThreshold, oKisWithinMaxEntryDistance, oKisUpperBreakoutCountExceeded, minEntryDistanceDOWN, maxEntryDistanceDOWN, maxLowerBreakouts, oKisAfterBarsSinceResetDown, oKisBelovLowerThreshold, oKisWithinMaxEntryDistanceDown, oKisLowerBreakoutCountExceeded, fminADX, fmaxADX, oKisADX, fminATR, fmaxATR, oKisATR, fperiodVol, oKisVOL, minimumTicks, maximumTicks, showLimusineOpenCloseUP, showLimusineOpenCloseDOWN, showLimusineHighLowUP, showLimusineHighLowDOWN);
}
public Indicators.ninpai.VAB20092024V2 VAB20092024V2(ISeries<double> input , int resetPeriod, int minBarsForSignal, int minEntryDistanceUP, int maxEntryDistanceUP, int maxUpperBreakouts, bool oKisAfterBarsSinceResetUP, bool oKisAboveUpperThreshold, bool oKisWithinMaxEntryDistance, bool oKisUpperBreakoutCountExceeded, int minEntryDistanceDOWN, int maxEntryDistanceDOWN, int maxLowerBreakouts, bool oKisAfterBarsSinceResetDown, bool oKisBelovLowerThreshold, bool oKisWithinMaxEntryDistanceDown, bool oKisLowerBreakoutCountExceeded, double fminADX, double fmaxADX, bool oKisADX, double fminATR, double fmaxATR, bool oKisATR, int fperiodVol, bool oKisVOL, int minimumTicks, int maximumTicks, bool showLimusineOpenCloseUP, bool showLimusineOpenCloseDOWN, bool showLimusineHighLowUP, bool showLimusineHighLowDOWN)
{
return indicator.VAB20092024V2(input, resetPeriod, minBarsForSignal, minEntryDistanceUP, maxEntryDistanceUP, maxUpperBreakouts, oKisAfterBarsSinceResetUP, oKisAboveUpperThreshold, oKisWithinMaxEntryDistance, oKisUpperBreakoutCountExceeded, minEntryDistanceDOWN, maxEntryDistanceDOWN, maxLowerBreakouts, oKisAfterBarsSinceResetDown, oKisBelovLowerThreshold, oKisWithinMaxEntryDistanceDown, oKisLowerBreakoutCountExceeded, fminADX, fmaxADX, oKisADX, fminATR, fmaxATR, oKisATR, fperiodVol, oKisVOL, minimumTicks, maximumTicks, showLimusineOpenCloseUP, showLimusineOpenCloseDOWN, showLimusineHighLowUP, showLimusineHighLowDOWN);
}
}
}
namespace NinjaTrader.NinjaScript.Strategies
{
public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
{
public Indicators.ninpai.VAB20092024V2 VAB20092024V2(int resetPeriod, int minBarsForSignal, int minEntryDistanceUP, int maxEntryDistanceUP, int maxUpperBreakouts, bool oKisAfterBarsSinceResetUP, bool oKisAboveUpperThreshold, bool oKisWithinMaxEntryDistance, bool oKisUpperBreakoutCountExceeded, int minEntryDistanceDOWN, int maxEntryDistanceDOWN, int maxLowerBreakouts, bool oKisAfterBarsSinceResetDown, bool oKisBelovLowerThreshold, bool oKisWithinMaxEntryDistanceDown, bool oKisLowerBreakoutCountExceeded, double fminADX, double fmaxADX, bool oKisADX, double fminATR, double fmaxATR, bool oKisATR, int fperiodVol, bool oKisVOL, int minimumTicks, int maximumTicks, bool showLimusineOpenCloseUP, bool showLimusineOpenCloseDOWN, bool showLimusineHighLowUP, bool showLimusineHighLowDOWN)
{
return indicator.VAB20092024V2(Input, resetPeriod, minBarsForSignal, minEntryDistanceUP, maxEntryDistanceUP, maxUpperBreakouts, oKisAfterBarsSinceResetUP, oKisAboveUpperThreshold, oKisWithinMaxEntryDistance, oKisUpperBreakoutCountExceeded, minEntryDistanceDOWN, maxEntryDistanceDOWN, maxLowerBreakouts, oKisAfterBarsSinceResetDown, oKisBelovLowerThreshold, oKisWithinMaxEntryDistanceDown, oKisLowerBreakoutCountExceeded, fminADX, fmaxADX, oKisADX, fminATR, fmaxATR, oKisATR, fperiodVol, oKisVOL, minimumTicks, maximumTicks, showLimusineOpenCloseUP, showLimusineOpenCloseDOWN, showLimusineHighLowUP, showLimusineHighLowDOWN);
}
public Indicators.ninpai.VAB20092024V2 VAB20092024V2(ISeries<double> input , int resetPeriod, int minBarsForSignal, int minEntryDistanceUP, int maxEntryDistanceUP, int maxUpperBreakouts, bool oKisAfterBarsSinceResetUP, bool oKisAboveUpperThreshold, bool oKisWithinMaxEntryDistance, bool oKisUpperBreakoutCountExceeded, int minEntryDistanceDOWN, int maxEntryDistanceDOWN, int maxLowerBreakouts, bool oKisAfterBarsSinceResetDown, bool oKisBelovLowerThreshold, bool oKisWithinMaxEntryDistanceDown, bool oKisLowerBreakoutCountExceeded, double fminADX, double fmaxADX, bool oKisADX, double fminATR, double fmaxATR, bool oKisATR, int fperiodVol, bool oKisVOL, int minimumTicks, int maximumTicks, bool showLimusineOpenCloseUP, bool showLimusineOpenCloseDOWN, bool showLimusineHighLowUP, bool showLimusineHighLowDOWN)
{
return indicator.VAB20092024V2(input, resetPeriod, minBarsForSignal, minEntryDistanceUP, maxEntryDistanceUP, maxUpperBreakouts, oKisAfterBarsSinceResetUP, oKisAboveUpperThreshold, oKisWithinMaxEntryDistance, oKisUpperBreakoutCountExceeded, minEntryDistanceDOWN, maxEntryDistanceDOWN, maxLowerBreakouts, oKisAfterBarsSinceResetDown, oKisBelovLowerThreshold, oKisWithinMaxEntryDistanceDown, oKisLowerBreakoutCountExceeded, fminADX, fmaxADX, oKisADX, fminATR, fmaxATR, oKisATR, fperiodVol, oKisVOL, minimumTicks, maximumTicks, showLimusineOpenCloseUP, showLimusineOpenCloseDOWN, showLimusineHighLowUP, showLimusineHighLowDOWN);
}
}
}
#endregion