Repaints NSDT HAMA Candles + SSL Channel For ThinkOrSwim

Repaints
@a1cturner I tried using this FlexGrid and it doesn't color. Is there something I need to do to get it to color Red/Green depending on the conditions met. I was hoping to get it to work like your other FlexGrid (Which is awesome BTW). It just makes the search much easier.
I didn’t add in the background color code. I just provided you with the flex grid with the original code.
 
This trading indicator is great. Thank you very much. In addition to adding adx code, this revised code's input parameters differ from the initial code posted on July 11 2022 when you started this thread, in my observation. I was just curious if there was a purpose for changing the input settings and if the modified code had a higher win rate than the previous one?. As far as I can tell, the older code is more in line with the Trading View code (https://www.tradingview.com/script/k7nrF2oI-NSDT-HAMA-Candles) than the more recent code. Thank you


original code


input TrendLength = 55;
input TrendType = {default WMA, SMA, EMA, HMA};

script mat {
input source = close;
input length = 0;
input type = "WMA";
def mat;
mat =
if type == "SMA" then SimpleMovingAvg(source, length) else
if type == "EMA" then ExpAverage(source, length) else
if type == "WMA" then WMA(source, length) else
if type == "HMA" then WMA(2 * WMA(source, length / 2) - WMA(source, length), Round(Sqrt(length)))
else Double.nan;
plot result = mat;
}



Revised code


input HAMALength = 69;
input HAMAType = {WMA, SMA,default EMA, HMA};

script mat {
input source = close;
input length = 69;
input type = "EMA";
def mat;
mat =
if type == "SMA" then SimpleMovingAvg(source, length) else
if type == "EMA" then ExpAverage(source, length) else
if type == "WMA" then WMA(source, length) else
if type == "HMA" then WMA(2 * WMA(source, length / 2) - WMA(source, length), Round(Sqrt(length)))
else Double.nan;
plot result = mat;
}

it is preferences based on the timeframe and the market you trade with.
 
it is preferences based on the timeframe and the market you trade with.
I appreciate your response. I trade etfs (QQQ , IWM , SPY) on the 1 and 2 minute time frames . Would you kindly inform me of the input parameters that are most appropriate for this market and time frame?. Thanks a lot
 
I appreciate your response. I trade etfs (QQQ , IWM , SPY) on the 1 and 2 minute time frames . Would you kindly inform me of the input parameters that are most appropriate for this market and time frame?. Thanks a lot
You need to test it and paper trade it till you reach to your confidant settings.
 
You need to test it and paper trade it till you reach to your confidant settings.
I appreciate your response. Although the difference is very little, in my experience, your old code (first version) produces more precise signals for the 1 and 2 minute time frames. I believed that your signal was the best indicator in the entire usethinkscript forums. once more, many thanks
 
@METAL This is the closest I could get as of now. See if this helps

Code:
#JT_ADX

declare lower;

input length = 14;
input averageType = AverageType.WILDERS;

plot ADX = DMI(length, averageType).ADX;
ADX.setDefaultColor(color.blue);

plot line = 20;
line.setDefaultColor(color.white);

AddCloud(ADX, 20, color.green, color.red);

aRgtPPN.png
Thanks. I am sorry if I have been all over the place. I was asking if there is a way to make the FlexGrid that you created for this strategy to change from red to green if the conditions are met. Like you did with the Jt Strat. That is a great way to know when stocks/options are ready. My biggest issue with this strategy is getting in on time. I already got the ADX color code and it works great. Thanks.
 
Hey @Santhosh , Thanks for the update. What is the condition for the color changes?
@METAL For your information, Samer800, not I, wrote the message "I added background option. Posted in the main code. check it out", indicator code, and changes. The code for the background option that Samer800 posted is

AssignBackgroundColor(if BackgroundColor then
if StrongUP and close > UpHigh then GlobalColor("BGBull") else
if StrongDN and close < DnLow then GlobalColor("BGBear") else
Color.CURRENT else Color.CURRENT);
 
@METAL For your information, Samer800, not I, wrote the message "I added background option. Posted in the main code. check it out", indicator code, and changes. The code for the background option that Samer800 posted is

AssignBackgroundColor(if BackgroundColor then
if StrongUP and close > UpHigh then GlobalColor("BGBull") else
if StrongDN and close < DnLow then GlobalColor("BGBear") else
Color.CURRENT else Color.CURRENT);
Whoops.. I thought I was responding to Samer. BTW! The FlexGrid color is working amazingly. Definitely a game changer! Thanks @samer800
It was the blue S that got me..LOL
 
Last edited:
assignbackgroundcolor(if "ADX > 20" then color.green else if "ADX < 20" then color.red else color.current);

Obviously substitute the quoted sections with the actual criteria you need to be met.

I also add an input like:
input backgroundcolor = no;

I then add that to my code so I can turn it off on settings on my main chart.

assignbackgroundcolor(if backgroundcolor and "ADX > 20" then color.green else if backgroundcolor and "ADX < 20" then color.red else color.current);
Got it.. Is there a way to only color the lower indicator window?
 
Last edited:
Got it.. Is there a way to only color the lower indicator window?

Code:
#JT_ADX

declare lower;

input length = 14;
input averageType = AverageType.WILDERS;

plot ADX = DMI(length, averageType).ADX;
ADX.setDefaultColor(color.blue);

plot line = 20;
line.setDefaultColor(color.white);

AddCloud(ADX, 20, color.green, color.red);

aRgtPPN.png
 
Last edited by a moderator:

Ver 1.2
* added RSI filter, Background Color, some signal enhancement.



Code:
#study("NSDT HAMA Candles", overlay=true)
#//The follow gradient code is taken from the Pinecoders Gradient Framework example.
#//https://www.tradingview.com/script/hqH4YIFa-Color-Gradient-Framework-PineCoders/
#https://www.tradingview.com/script/k7nrF2oI-NSDT-HAMA-Candles/
# included SSL Channel https://www.tradingview.com/script/6y9SkpnV-SSL-Channel/
# Youtube strategy https://www.youtube.com/watch?v=YJrELewfIrU
#Converted by Sam4Cok @ 07/2022
#Ver 1.1 by Sam4Cok @ 07/2022  -- Added Filters (ADX / TDFI / Range Indicator and options to Show/Hide indicators
#Ver 1.2 by Sam4COK @ 07/2022 -- Added Background Color, RSI Filter, signal enhancment.

#//INPUTS
input ColorBar   = no;
input showArrow  = yes;
input BackgroundColor = no;
### NSDT ###
input TrendSource = close;
input HAMALength  = 69;
input HAMAType    = {default EMA, WMA, SMA, HMA};
input HAMABar     = yes;
input HAMAMa      = yes;
#//MA INFO
input OpenLength  = 25;                      #"Length Open"
input OpenType    = {default EMA, SMA, WMA}; #"Type Open"
input HighLength  = 20;                      #"Length High"
input HighType    = {default EMA, SMA, WMA}; #"Type High"
input LowLength   = 20;                      #"Low"
input LowType     = {default EMA, SMA, WMA}; #"Type Low"
input CloseLength = 20;                     #"Length Close"
input CloseType   = {default EMA, SMA, WMA}; #"Close"
### SSL1Source ###
input ShowSSL   = yes; #(true, "Highlight State ?")
input SSLWicks  = no;#(false, "Take Wicks into Account ?")
input SSLType   = {WMA, default SMA, EMA, HMA};
input SSL_MaLength = 69; #"MA "Channel ?
### RSI ###
input RSIFilter = no;
input RSILength = 30;
input RSIMovAvg = 200;
### TDFI ###
input TDFIFilter = no;
input TDFIPeriod =  11;   # "Lookback"
input TDFIAbove  =  0.03; # "Filter High"
input TDFIBelow  = -0.03; # "Filter Low"
### ADX ###
input ADXFilter = no;
input ADXLength = 11;
input ADXLimit  = 20;
### Range Indicator
input RangeIndicatorFilter = no;
input RILength       = 11;
input RangeLimit     = 20;
input RangeSmoothing = 5;
##################
def na = Double.NaN;
########## Colors ########
DefineGlobalColor("Bull"        , CreateColor(38, 166, 154)); # HAMA GREEN - Teal
DefineGlobalColor("Bear"        , CreateColor(239, 83, 80));  # HAMA Red
DefineGlobalColor("WeakBull"    , CreateColor(204, 204, 0));  # HAMA DARK Yellow 
DefineGlobalColor("WeakBear"    , CreateColor(255, 128, 0));  # HAMA Orange
DefineGlobalColor("Neutral"     , CreateColor(255, 255, 0));  # HAMA Yellow

DefineGlobalColor("BullBar"     , CreateColor(0, 255, 0));    # GREEN
DefineGlobalColor("WeakBullBar" , CreateColor(0, 128, 0));    # Dark GREEN
DefineGlobalColor("BearBar"     , CreateColor(255, 0, 0));    # Red
DefineGlobalColor("WeakBearBar" , CreateColor(128, 0, 0));   # DARK RED
DefineGlobalColor("NeutralBar"  , CreateColor(255, 255, 0));  # yellow

DefineGlobalColor("BGBull"      , CreateColor (153, 255, 153));
DefineGlobalColor("BGBear"      , CreateColor (255, 153, 153));
#////////////////////////////////////////////////////////////////////////////////
#mat(source, length, type) =>
script mat {
    input source = close;
    input length = 69;
    input type   = "EMA";
    def mat;
    mat =
    if type == "SMA" then SimpleMovingAvg(source, length) else
    if type == "EMA" then ExpAverage(source, length) else
    if type == "WMA" then WMA(source, length) else
    if type == "HMA" then WMA(2 * WMA(source, length / 2) - WMA(source, length), Round(Sqrt(length)))
       else Double.NaN;
    plot result = mat;
}

def ma = WMA(TrendSource, HAMALength);

#//GRADIENT AREA
def center  = ExpAverage(ma, 3);
def xUp     = ma crosses above center;
def xDn     = ma crosses below center;
def chg     = ma - ma[1];
def up      = chg > 0;
def dn      = chg < 0;
def srcBull = ma > center;
def srcBear = ma < center;

#### TREND####
def StrongUP = srcBull and up;
def WeakUp   = srcBull and dn;
def StrongDN = srcBear and dn;
def WeakDN   = srcBear and up;
def Neutral  = xUp or xDn or !StrongUP and !StrongDN and !WeakUp and !WeakDN;

def SourceClose = (open + high + low + close) / 4;
def LengthClose = CloseLength;

def SourceOpen = CompoundValue(1, (SourceOpen[1] + SourceClose[1]) / 2, SourceClose) ;
def LengthOpen = OpenLength;

def SourceHigh = Max(Max(high, SourceOpen), SourceClose);
def LengthHigh = HighLength;

def SourceLow = Min(Min(low, SourceOpen), SourceClose);
def LengthLow = LowLength;

#funcCalcMA1(type1, src1, len1) =>
script funcCalcMA1 {
    input type1 = "EMA";
    input src1  = close;
    input len1  = 0;
    def funcCalcMA1;
    funcCalcMA1 = if type1 == "SMA" then SimpleMovingAvg(src1, len1) else
                  if type1 == "EMA" then ExpAverage(src1, len1) else WMA(src1, len1);
    plot result = funcCalcMA1;
}
#funcCalcOpen(TypeOpen, SourceOpen, LengthOpen) =>
script funcCalcOpen {
    input TypeOpen   = "EMA";
    input SourceOpen = close;
    input LengthOpen = 0;
    def funcCalcOpen;
    funcCalcOpen = if TypeOpen == "SMA" then SimpleMovingAvg(SourceOpen, LengthOpen) else
                   if TypeOpen == "EMA" then ExpAverage(SourceOpen, LengthOpen) else WMA(SourceOpen, LengthOpen);
    plot result = funcCalcOpen;
}
#funcCalcHigh(TypeHigh, SourceHigh, LengthHigh) =>
script funcCalcHigh {
    input TypeHigh   = "EMA";
    input SourceHigh = close;
    input LengthHigh = 0;
    def funcCalcHigh;
    funcCalcHigh = if TypeHigh == "SMA" then SimpleMovingAvg(SourceHigh, LengthHigh) else
                   if TypeHigh == "EMA" then ExpAverage(SourceHigh, LengthHigh) else WMA(SourceHigh, LengthHigh);
    plot result = funcCalcHigh;
}
#funcCalcLow(TypeLow, SourceLow, LengthLow) =>
script funcCalcLow {
    input TypeLow   = "EMA";
    input SourceLow = close;
    input LengthLow = 0;
    def funcCalcLow;
    funcCalcLow = if TypeLow == "SMA" then SimpleMovingAvg(SourceLow, LengthLow) else
                  if TypeLow == "EMA" then ExpAverage(SourceLow, LengthLow) else WMA(SourceLow, LengthLow);
    plot result = funcCalcLow;
}
#funcCalcClose(TypeClose, SourceClose, LengthClose) =>
script funcCalcClose {
    input TypeClose   = "EMA";
    input SourceClose = close;
    input LengthClose = 0;
    def funcCalcClose;
    funcCalcClose = if TypeClose == "SMA" then SimpleMovingAvg(SourceClose, LengthClose) else
                    if TypeClose == "EMA" then ExpAverage(SourceClose, LengthClose) else WMA(SourceClose, LengthClose);
    plot result = funcCalcClose;
}

# Plot the new Chart
def CandleOpen  = funcCalcOpen(OpenType, SourceOpen, LengthOpen);
def CandleHigh  = funcCalcHigh(HighType, SourceHigh, LengthHigh);
def CandleLow   = funcCalcLow(LowType, SourceLow, LengthLow);
def CandleClose = funcCalcClose(CloseType, SourceClose, LengthClose);

def MAValue  = funcCalcMA1(HAMAType, TrendSource, HAMALength);

plot MALine = if HAMAMa then MAValue else na;
MALine.SetStyle(Curve.FIRM);
MALine.AssignValueColor( if StrongUP then GlobalColor("Bull")     else
                         if WeakUp   then GlobalColor("WeakBull") else
                         if StrongDN then GlobalColor("Bear")     else
                         if WeakDN   then GlobalColor("WeakBear") else GlobalColor("Neutral"));
MALine.SetLineWeight(1);

# Plot STRONG UP
def UpO1;
def UpH1;
def UpL1;
def UpC1;
if StrongUP and HAMABar
then {
    UpO1 = if CandleOpen < CandleClose then CandleClose else CandleOpen;
    UpH1 = if CandleHigh > CandleClose then CandleClose else CandleHigh;
    UpL1 = if CandleLow  < CandleOpen  then CandleOpen  else CandleLow;
    UpC1 = if CandleOpen < CandleClose then CandleOpen  else CandleClose;
} else
{
    UpO1 = na;
    UpH1 = na;
    UpL1 = na;
    UpC1 = na;
}
# Plot WEAK UP
def UpO;
def UpH;
def UpL;
def UpC;
if WeakUp and HAMABar
then {
    UpO = if CandleOpen < CandleClose then CandleClose else CandleOpen;
    UpH = if CandleHigh > CandleClose then CandleClose else CandleHigh;
    UpL = if CandleLow  < CandleOpen  then CandleOpen else CandleLow;
    UpC = if CandleOpen < CandleClose then CandleOpen else CandleClose;
} else
{
    UpO = na;
    UpH = na;
    UpL = na;
    UpC = na;
}
# Plot WEAK DOWN
def DnO;
def DnH;
def DnL;
def DnC;
if WeakDN and HAMABar
then {
    DnO = if CandleOpen < CandleClose then CandleClose else CandleOpen;
    DnH = if CandleHigh > CandleOpen then CandleOpen else CandleHigh;
    DnL = if CandleLow  < CandleClose then CandleClose else CandleLow;
    DnC = if CandleOpen < CandleClose then CandleOpen else CandleClose;
} else
{
    DnO = na;
    DnH = na;
    DnL = na;
    DnC = na;
}
# Plot STRONG DOWN
def DnO1;
def DnH1;
def DnL1;
def DnC1;
if StrongDN and HAMABar
then {
    DnO1 = if CandleOpen < CandleClose then CandleClose else CandleOpen;
    DnH1 = if CandleHigh > CandleOpen then CandleOpen else CandleHigh;
    DnL1 = if CandleLow  < CandleClose then CandleClose else CandleLow;
    DnC1 = if CandleOpen < CandleClose then CandleOpen else CandleClose;
} else
{
    DnO1 = na;
    DnH1 = na;
    DnL1 = na;
    DnC1 = na;
}
# Plot Neutral
def NuO;
def NuH;
def NuL;
def NuC;
if Neutral and HAMABar
then {
    NuO = if CandleOpen < CandleClose then CandleClose else CandleOpen;
    NuH = if CandleHigh > CandleOpen then CandleOpen else CandleHigh;
    NuL = if CandleLow  < CandleClose then CandleClose else CandleLow;
    NuC = if CandleOpen < CandleClose then CandleOpen else CandleClose;
} else
{
    NuO = na;
    NuH = na;
    NuL = na;
    NuC = na;
}
# Plot the new Chart
AddChart(high = UpH1, low = UpL1, open = UpO1, close = UpC1,
         type = ChartType.CANDLE, growcolor =  GlobalColor("Bull"));
AddChart(high = UpH , low = UpL , open = UpO,  close = UpC,
         type = ChartType.CANDLE, growcolor =  GlobalColor("WeakBull"));

AddChart(high = DnH1, low = DnL1, open = DnO1, close = DnC1,
         type = ChartType.CANDLE, growcolor =  GlobalColor("Bear"));
AddChart(high = DnH , low = DnL , open = DnO,  close = DnC,
         type = ChartType.CANDLE, growcolor =  GlobalColor("WeakBear"));

AddChart(high = NuH , low = NuL , open = NuO,  close = NuC,
         type = ChartType.CANDLE, growcolor =  GlobalColor("Neutral"));
########
#indicator("SSL Channel", by MissTricky)
#https://www.tradingview.com/script/6y9SkpnV-SSL-Channel/
def ma1 = mat(high,SSL_MaLength, SSLType);
def ma2 = mat(low ,SSL_MaLength, SSLType);

def Hlv1 = if (if SSLWicks then high else close) > ma1 then 1 else
           if (if SSLWicks then low  else close) < ma2 then -1 else Hlv1[1];
def Hlv = Hlv1;

def sslUp   = if Hlv < 0 then ma2 else ma1;
def sslDown = if Hlv < 0 then ma1 else ma2;

def SSLBull = Hlv1 > 0 and Hlv1[1] < 0;
def SSLBear = Hlv1 < 0 and Hlv1[1] > 0;

plot highLine = if ShowSSL then sslUp else na;
plot lowLine  = if ShowSSL then sslDown else na;

highLine.AssignValueColor(if Hlv > 0 then Color.GREEN else color.RED);
lowLine.AssignValueColor( if Hlv > 0 then Color.GREEN else color.RED);

highLine.AssignValueColor(if Hlv > 0 then Color.GREEN else Color.RED);
lowLine.AssignValueColor( if Hlv > 0 then Color.GREEN else Color.RED);

AddCloud (highLine, lowLine, Color.DARK_GREEN, Color.DARK_RED, no);

##### RSI
def RSIup   = WildersAverage(Max(close - close[1], 0), rsiLength);
def RSIdown = WildersAverage(-Min(close - close[1], 0), rsiLength);
def RSIvalue = if RSIdown == 0 then 100 else if RSIup == 0 then 0 else 100 - (100 / (1 + RSIup / RSIdown));
def RSIAvg   = SimpleMovingAvg(RSIvalue, RSIMovAvg);
def RSI = if RSIvalue > RSIAvg then  1 else
          if RSIvalue < RSIAvg then -1 else na;

##### TDFI
def mma  = ExpAverage(close * 1000, TDFIPeriod);
def smma = ExpAverage(mma, TDFIPeriod);
def impetmma  = mma - mma[1];
def impetsmma = smma - smma[1];
def divma = AbsValue(mma - smma);
def averimpet = (impetmma + impetsmma) / 2;
def tdf  = Power(divma, 1) * Power(averimpet, 3);
def TDFIvalue = tdf / Highest(AbsValue(tdf), TDFIPeriod * 3);
def TDFI = if TDFIvalue > TDFIAbove then  1 else
           if TDFIvalue < TDFIBelow then -1 else na;

###### ADX Filter
def ADXvalue = DMI(ADXLength, AverageType.WILDERS).ADX;
def ADX      = if ADXvalue >= ADXlimit then 1 else na;

###### Range Indicator
def data = TrueRange(high, close, low) / if close > close[1] then (close - close[1]) else 1;
def hData = Highest(data, RILength);
def lData = Lowest(data, RILength);
def range = 100 * (data - lData) / if hData > lData then (hData - lData) else 1;
def RIvalue = ExpAverage(range, RangeSmoothing);
def RI = if RIvalue >= Rangelimit then 1 else na;

### Signal###
def UpOpen = if CandleOpen < CandleClose then CandleClose else CandleOpen;
def UpHigh = if CandleHigh > CandleClose then CandleClose else CandleHigh;
def UpLow  = if CandleLow  < CandleOpen  then CandleOpen  else CandleLow;
def UpClose= if CandleOpen < CandleClose then CandleOpen  else CandleClose;

def DnOpen = if CandleOpen < CandleClose then CandleClose else CandleOpen;
def DnHigh = if CandleHigh > CandleOpen then CandleOpen else CandleHigh;
def DnLow  = if CandleLow  < CandleClose then CandleClose else CandleLow;
def DnClose= if CandleOpen < CandleClose then CandleOpen else CandleClose;

def HAMAHigh = close > CandleLow;
def HAMALow  = low < DnLow;

def SigUp    = if TDFIFilter then (SSLBull and close > MAValue and HAMAHigh and TDFI > 0)
                             else (SSLBull and close > MAValue and HAMAHigh);
def SigUp1   = if ADXFilter then SigUp and ADX else SigUp;
def SigUp2   = if RangeIndicatorFilter then SigUp1 and RI else SigUp1;
def SignalUp = if RSIFilter then SigUp2 and RSI > 0 else SigUp2;

def SigDN = if TDFIFilter then (SSLBear and close < MAValue and HAMALow and TDFI < 0)
                          else (SSLBear and close < MAValue and HAMALow);
def SigDn1 = if ADXFilter then SigDn and ADX else SigDn;
def SigDn2 = if RangeIndicatorFilter then SigDn1 and RI else SigDn1;
def SignalDn = if RSIFilter then SigDn2 and RSI < 0 else SigDn2;

plot Arrow_Up = if showArrow and SignalUp then low  else na;
plot Arrow_Dn = if showArrow and SignalDn then high else na;

Arrow_Up.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
Arrow_Up.SetDefaultColor(Color.WHITE);
Arrow_Up.SetLineWeight(3);

Arrow_Dn.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
Arrow_Dn.SetDefaultColor(Color.YELLOW);
Arrow_Dn.SetLineWeight(3);

##### Background & Price Color
AssignPriceColor(if ColorBar  then
                  if Neutral  then GlobalColor("NeutralBar")  else
                  if StrongUP and close < UpHigh then GlobalColor("WeakBullBar") else
                  if StrongUP and close > UpHigh then GlobalColor("BullBar")     else
                  if StrongDN and close < DnLow  then GlobalColor("BearBar")     else
                  if StrongDN and close > DnLow then GlobalColor("WeakBearBar")  else
                                                 Color.DARK_ORANGE else Color.CURRENT);

AssignBackgroundColor(if BackgroundColor then
                  if StrongUP and close > UpHigh then GlobalColor("BGBull") else
                  if StrongDN and close < DnLow  then GlobalColor("BGBear") else
                    Color.CURRENT else Color.CURRENT);

### ENd ####
So what are the parameters for the up and down arrow? I'd like to make my own scan since its a stadegy and not a study.
 
I continue to be impressed by this Strategy. Right now I am using a 987Tick chart, with a 2000T and a 3M chart for confirmation.

The 3M I just have VWAP, (because you can't see VWAP on a tick chart I don't believe) and the Andean Oscillator to validate that I am trading with the prevailing trend.

On both of my tick charts I am using a DCPR provided by @bigboss to show the "macro-trend". If the DCPR cloud is green, I don't short the underlying no matter what NSDT HAMA says, and vice versa for longs. This has helped me avoid "guessing" if we truly have a reversal or not...I asked about this in an earlier question.

Further, I am using a stripped down version of the B4 to help time entries, though I am relying on it less and less. As well, I am using the TEA indicator to help identify chop.

Essentially if the 2000T and 987T are in agreement, I feel very good about my entries.

Just to make sure I'm understanding NSDT...for longs, we want Regular candles above HAMA candles Blue and above the Moving Average line that turns from pink to blue...and both of these should be above the SSL (turns from red to green)?

Vice Versa for longs:
Regular candles below HAMA candles (pink), below the Moving Average Line that turns from blue to pink, and all of these are below the SSL (Turns from green to red)

If anyone has any feedback I would appreciate it....below is my Flexible Grid in case anyone is interested

https://tos.mx/nesHbqI
 
Last edited:
I continue to be impressed by this Strategy. Right now I am using a 987Tick chart, with a 2000T and a 3M chart for confirmation.

The 3M I just have VWAP, (because you can't see VWAP on a tick chart I don't believe) and the Andean Oscillator to validate that I am trading with the prevailing trend.

On both of my tick charts I am using a DCPR provided by @bigboss to show the "macro-trend". If the DCPR cloud is green, I don't short the underlying no matter what NSDT HAMA says, and vice versa for longs. This has helped me avoid "guessing" if we truly have a reversal or not...I asked about this in an earlier question.

Further, I am using a stripped down version of the B4 to help time entries, though I am relying on it less and less. As well, I am using the TEA indicator to help identify chop.

Essentially if the 2000T and 987T are in agreement, I feel very good about my entries.

Just to make sure I'm understanding NSDT...for longs, we want Regular candles above HAMA candles Blue and above the Moving Average line that turns from pink to blue...and both of these should be above the SSL (turns from red to green)?

Vice Versa for longs:
Regular candles below HAMA candles (pink), below the Moving Average Line that turns from blue to pink, and all of these are below the SSL (Turns from green to red)

If anyone has any feedback I would appreciate it....below is my Flexible Grid in case anyone is interested

https://tos.mx/nesHbqI
that's correct. In addition, I added couple of filters to select from. RSI, TDFI, ADX and Range filter. All disabled as default setting. You can try to enable them and play with the setting till you reach to a comfortable way of risk. enjoy!
 
that's correct. In addition, I added couple of filters to select from. RSI, TDFI, ADX and Range filter. All disabled as default setting. You can try to enable them and play with the setting till you reach to a comfortable way of risk. enjoy!
Hey @samer800 , Will you be so kind as to share the DCPR code? I went to the thread with the DCPR but I can only get a code for the green and red clouds. I cannot locate a code for the purple cloud. Thanks.
 
@samer800 BTW, This is my most successful scalping strat. Have you use the new filters that you added? I do not see any changes when I turn them on and mess with the settings. Just curious.
 
@samer800 BTW, This is my most successful scalping strat. Have you use the new filters that you added? I do not see any changes when I turn them on and mess with the settings. Just curious.
these are signal filters. You need to enable the required filter and change the setting if needed. enabling and disabling the filter wont change the chart or plot, it will affect the signal arrows only.
 
Hey @samer800 , Will you be so kind as to share the DCPR code? I went to the thread with the DCPR but I can only get a code for the green and red clouds. I cannot locate a code for the purple cloud. Thanks.
here we go and more

CSS:
# Combined and mod  by Sam4COK @ samer800 - 08/2022
# Request from https://usethinkscript.com
# Logical Trader's Pivot Range
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/aaiSbWNj-Pivot-Range-Pivot-Boss/

input timeFrame = {default DAY, WEEK, MONTH};
input showCPRLines = yes;
input showCPRCloud = yes;

def na = Double.NaN;

def PH = high(period = timeFrame);
def PL = low(period = timeFrame);
def PC = close(period = timeFrame);
#def PH = If(GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN, high(period = timeFrame), na);
#def PL = If(GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN, low(period = timeFrame), na);
#def PC = If(GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN, close(period = timeFrame), na);

def pivot = (PH + PL + PC) / 3.0;
def bc = (PH + PL) / 2.0;
def tc = (pivot - bc) + pivot;

plot PivotLine = pivot[1];
plot l2 = bc[1];
plot l3 = tc[1];

AddCloud(if showCPRCloud then l2 else na, l3, Color.GRAY, Color.DARK_GRAY, no);
PivotLine.SetPaintingStrategy(PaintingStrategy.DASHES);
PivotLine.SetDefaultColor(Color.WHITE);
PivotLine.SetLineWeight(1);
l2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
l2.SetDefaultColor(Color.GRAY);
l2.SetLineWeight(1);
l3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
l3.SetDefaultColor(Color.GRAY);
l3.SetLineWeight(1);

l2.SetHiding(!showCPRLines);
l3.SetHiding(!showCPRLines);

# Developing CPR (CPR)
# by bigboss
# Version 1.0

input showTcBcLines = no;
input showCloud = yes;

def o = open;
def h = high;
def l = Low;
def c = Close;

def today = GetYYYYMMDD();

def rollover = today <> today[1];

def dh = if rollover or h > dh[1] then h else dh[1];
def dl = if rollover or l < dl[1] then l else dl[1];

plot dcp = (dh + dl + c) / 3;
plot dbc = (dh + dl) / 2;
plot dtc = (dcp - dbc) + dcp;

dcp.AssignValueColor(if dtc > dbc then Color.GREEN else Color.RED);
dtc.AssignValueColor(if dtc > dbc then Color.LIGHT_GREEN else Color.LIGHT_RED);
dbc.AssignValueColor(if dtc > dbc then Color.DARK_GREEN else Color.DARK_RED);

AddCloud(if showCloud then dtc else na,if showCloud then dbc else na,Color.DARK_GREEN,Color.DARK_RED, no);

dbc.SetHiding(!showTcBcLines);
dtc.SetHiding(!showTcBcLines);

dbc.SetLineWeight(2);

# End
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Thread starter Similar threads Forum Replies Date
C Confirmation Candles Indicator For ThinkorSwim Strategies & Chart Setups 2607

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
333 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top