Inside Day and NR4 Indicator for ThinkorSwim with Strategy

BenTen

BenTen

Administrative
Staff
VIP
Warehouse
An inside day occurs when the stock trades within the range of the previous day high and low. Combining with Narrow Range 4 or known as NR4 will provide a high probability of trading the breakout or breakdown of the inside day bar.

Identify Inside Day:
  • When the bar is within the high and low of its previous day.

Identify NR4:
  • Made up of 4 bars
  • Most recent candlestick will have a range that is smaller than the 3 previous bars.
Below is the indicator that applies the rules on how to identify Inside Day and NR4. This way you can easily figure out when we have an Inside Day with "narrow-range-4-bars".

So instead of just looking for inside day candlestick, we're now looking for an inside day with a range that is smaller than the 3 previous bars.

thinkScript Code

Rich (BB code):
def lowVol = (VolatilityStdDev(6) / VolatilityStdDev(100)) < 0.5;
def insideDay = high < high[1] and low > low[1];
def range = high - low;
def NR4 = range < Lowest(range[1], 3);
plot signal = lowVol and insideDay and NR4;
plot signal2 = lowVol and insideDay and NR4;
     signal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
     signal.SetDefaultColor(Color.MAGENTA);
     signal.SetLineWeight(1);
signal2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
     signal2.SetDefaultColor(Color.MAGENTA);
     signal2.SetLineWeight(1);

Inside Day + NR4 Scanner

Rich (BB code):
def lowVol = (VolatilityStdDev(6) / VolatilityStdDev(100)) < 0.5;
def insideDay = high < high[1] and low > low[1];
def range = high - low;
def NR4 = range < Lowest(range[1], 3);
def s = lowVol and insideDay and NR4;
plot signal = s within 1 bars;
Now that you have the indicator and scanner on your ThinkorSwim, here is the guide on how to trade this particular inside day candlestick that includes the NR4 rules.

Inside Day and Narrow Range 4 Strategy

After you add the indicator, it will plot arrows pointing at any inside days. Here is an example.



The above screenshot is $BABA 6m 1D timeframe with 2 inside days.

The strategy for trading this is fairly simple. You plot the high and low of the Inside Day bar. Something like this:



You can initiate a long position if the candlestick breaks above the high of the Inside Day bar or short the stock if the candlestick breaks below the low of the Inside Day bar.

  • For long, stop loss would be the low of the Inside Day bar.
  • For short, stop loss would be the high of the Inside Day bar.
That is how I would personally trade Inside Day + NR4.

A few more examples:











Good luck with trading :)

Credits:
 
Last edited:
C

Chenthy73

New member
You would use it mainly on the daily chart? Thanks

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Chenthy73 Daily and Hourly would be my go to for this indicator.

 
Last edited:
S

Steve2286

New member
VIP
Ben - I've never run a scan before - where does the code get pasted ?

tks

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
Warehouse
@Steve2286 Go to the Scan page, add new Study filter, remove the existing one and then paste the code into the thinkScript section.

 
Last edited:

Top