The idea of the following two Condition Sets is to adjust Connors RSI thresholds for identifying entry or reversal prices. In the first Condition Set, my intention is to increment the entry SignalThreshold variable by a constant double I've defined as SlopeFactor.
In the second Condition Set, my intention is to increment the newly calculated revised value of SignalThreshold by SlopeFactor a second time, if the Daily Range of the trading session is at least TargetBDistance (another double variable).
Thus, my intention is for SignalThreshold to increment higher by SlopeFactor when market has not attained something I've defined as OppositeThreshold. But if market has not reached OppositeThreshold when Daily Range is at least TargetBDistance wide, I want NT to increment SignalThreshold again. Speaking generically, for this second case, the result should be SignalThreshold + SlopeFactor + SlopeFactor.
I believe either my brackets are misplaced, or maybe I've not written my condition correctly. The Output Window only shows those adjustments NT has made in the second case, as if it has ignored the first case. (Note in my coded Print statements, I've labeled those changes (1) and (2), so I can know which Condition Set has changed SignalThreshold and which has not.)
As always, I will appreciate any suggestions provided in this forum.
Thanks.
==========
Extracted Condition Sets from my strategy:
// If CRSI has NOT FALLEN BELOW OppositeThreshold during LookbackPeriod, market is not weak and sell signals could be premature:
if (OppositeThreshold < MIN(anaConnorsRSI(240, 3, 2).ConnorsRSI, LookbackPeriod)[0])
{
SignalThreshold = Math.Min(100.0, Math.Max(0.0, SignalThreshold + SlopeFactor));
OppositeThreshold = Math.Min(100.0, Math.Max(0.0, OppositeThreshold + SlopeFactor));
Counter = 0;
Print("Timestamp for FPSell Threshold Change (1): " + Time[0]);
Print("Counter = " + Counter);
Print("initialThreshold = " + initialThreshold);
Print("signalThreshold = " + signalThreshold);
Print("oppositeThreshold = " + oppositeThreshold);
}
// If current range has expanded beyond TargetBDistance while market is not weak, sell signals could be premature:
if (TargetBDistance <= CurrentDayOHL().CurrentHigh[0] - CurrentDayOHL().CurrentLow[0]
&& OppositeThreshold < MIN(anaConnorsRSI(240, 3, 2).ConnorsRSI, LookbackPeriod)[0])
{
SignalThreshold = Math.Min(100.0, Math.Max(0.0, SignalThreshold + SlopeFactor));
OppositeThreshold = Math.Min(100.0, Math.Max(0.0, OppositeThreshold + SlopeFactor));
Counter = 0;
Print("Timestamp for FPSell Threshold Change (2): " + Time[0]);
Print("Counter = " + Counter);
Print("initialThreshold = " + initialThreshold);
Print("signalThreshold = " + signalThreshold);
Print("oppositeThreshold = " + oppositeThreshold);
}
Comment