MTF_RSI for THINKORSWIM - ThinkOrSwim | futures io social day trading
futures io futures trading


MTF_RSI for THINKORSWIM
Updated: Views / Replies:4,363 / 35
Created: by alagrande Attachments:1

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 100,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

 
 1  
 
Thread Tools
 

MTF_RSI for THINKORSWIM

 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received

MTF_RSI for THINKORSWIM

declare lower;
###MTF_RSI###5MIN, 10MIN, 15,MIN.//// TREND LINE GREEN AND RED ###
###############################################
input length2 = 4;
input over_Bought2 = 75;
input over_Sold2 = 25;
input averageType2 = AverageType.WILDERS;
input PRICE = close;

def NetChgAvg2 = MovingAverage(averageType2, PRICE - PRICE[1], length2);
def TotChgAvg2 = MovingAverage(averageType2, AbsValue(PRICE - PRICE[1]), length2);
def ChgRatio = if TotChgAvg2 != 0 then NetChgAvg2 / TotChgAvg2 else 0;
##

plot RSI2 = 50 * (ChgRatio + 1);
##plot OverSold30 = over_Sold30;
##plot OverBough30 = over_Bought30;
RSI2.DefineColor("OverBought", Color.LIGHT_ORANGE);
RSI2.DefineColor("Normal", GetColor(7));
RSI2.DefineColor("OverSold", Color.LIGHT_RED);
RSI2.AssignValueColor(if RSI2 > over_Bought2 then RSI2.Color("OverBought") else if RSI2 < over_Sold2 then RSI2.Color("OverSold") else RSI2.Color("Normal"));
##OverSold30.SetDefaultColor(GetColor(8));
##OverBough30.SetDefaultColor(GetColor(8));
RSI2.SetLineWeight(2);
plot Zero = 0;
PLOT OCHENTA =80;

RSI2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);

#############################################
input length30 = 4;
input over_Bought30 = 75;
input over_Sold30 = 25;
input averageType30 = AverageType.WILDERS;

def NetChgAvg30 = MovingAverage(averageType30, close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1], length30);
def TotChgAvg30 = MovingAverage(averageType30, AbsValue(close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1]), length30);
def ChgRatio30 = if TotChgAvg30 != 0 then NetChgAvg30 / TotChgAvg30 else 0;
plot RSI30 = 50 * (ChgRatio30 + 1);
##plot OverSold30 = over_Sold30;
##plot OverBough30 = over_Bought30;
RSI30.DefineColor("OverBought", Color.LIGHT_ORANGE);
RSI30.DefineColor("Normal", GetColor(7));
RSI30.DefineColor("OverSold", Color.LIGHT_RED);
RSI30.AssignValueColor(if RSI30 > over_Bought30 then RSI30.Color("OverBought") else if RSI30 < over_Sold30 then RSI30.Color("OverSold") else RSI30.Color("Normal"));
##OverSold30.SetDefaultColor(GetColor(8));
##OverBough30.SetDefaultColor(GetColor(8));
RSI30.SetLineWeight(2);
plot Zero30 = 0;
RSI30.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);

###
input length15 = 4;
input over_Bought15 = 75;
input over_Sold15 = 25;
input averageType15 = AverageType.WILDERS;

def NetChgAvg15 = MovingAverage(averageType15, close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1], length15);
def TotChgAvg15 = MovingAverage(averageType15, AbsValue(close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1]), length15);
def ChgRatio15 = if TotChgAvg15 != 0 then NetChgAvg15 / TotChgAvg15 else 0;
plot RSI15 = 50 * (ChgRatio15 + 1);
#plot OverSold15 = over_Sold15;
#plot OverBough15 = over_Bought15;
RSI15.DefineColor("OverBought", Color.LIGHT_ORANGE);
RSI15.DefineColor("Normal", GetColor(7));
RSI15.DefineColor("OverSold", Color.LIGHT_RED);
RSI15.AssignValueColor(if RSI15 > over_Bought15 then RSI15.Color("OverBought") else if RSI15 < over_Sold15 then RSI15.Color("OverSold") else RSI15.Color("Normal"));
#OverSold15.SetDefaultColor(GetColor(8));
#OverBough15.SetDefaultColor(GetColor(8));
RSI15.SetLineWeight(4);
RSI15.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
###
###
input length31 = 4;
input over_Bought31 = 75;
input over_Sold31 = 25;
input averageType31 = AverageType.WILDERS;
def NetChgAvg31 = MovingAverage(averageType31, close(period = AggregationPeriod.FIFTEEN_MIN) - close(period = AggregationPeriod.FIFTEEN_MIN)[1], length30);
def TotChgAvg31 = MovingAverage(averageType31, AbsValue(close(period = AggregationPeriod.FIFTEEN_MIN) - close(period = AggregationPeriod.FIFTEEN_MIN)[1]), length31);
def ChgRatio31 = if TotChgAvg31 != 0 then NetChgAvg31 / TotChgAvg31 else 0;
plot RSI31 = 50 * (ChgRatio31 + 1);
#plot OverSold31 = over_Sold31;
#plot OverBough31 = over_Bought31;
RSI31.DefineColor("OverBought", Color.LIGHT_ORANGE);
RSI31.DefineColor("Normal", GetColor(7));
RSI31.DefineColor("OverSold", Color.LIGHT_RED);
RSI31.AssignValueColor(if RSI31 > over_Bought31 then RSI31.Color("OverBought") else if RSI31 < over_Sold31 then RSI31.Color("OverSold") else RSI15.Color("Normal"));
#OverSold31.SetDefaultColor(GetColor(8));
#OverBough31.SetDefaultColor(GetColor(8));
RSI31.SetLineWeight(3);
RSI31.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
##############################################
######TREND LINE##############################
###############################################
input fastLengthTrend = 7;#7
input slowLengthTrend = 15;#15
input trendLength = 4;#4
input noiseType = {default linear, squared};
input noiseLength = 250;
input correctionFactor = 2;


Assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
Assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

def reversal = TrendPeriods(fastLengthTrend, slowLengthTrend);

def cpc = if IsNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close - close[1];

def trend = if IsNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);
switch (noiseType) {
case linear:
noise = correctionFactor * Average(diff, noiseLength);
case squared:
noise = correctionFactor * Sqrt(Average(diff * diff, noiseLength));
}

plot TQ = if noise == 0 then 0 else trend / noise;
#plot ZeroLine = 0;

TQ.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
TQ.SetLineWeight(3);
TQ.DefineColor("Positive", Color.GREEN);
TQ.DefineColor("Negative", Color.RED);
TQ.AssignValueColor(if TQ > 0 then TQ.Color("Positive") else TQ.Color("Negative"));
#ZeroLine.SetDefaultColor(GetColor(5));
###############################################


Last edited by alagrande; November 30th, 2017 at 09:07 PM. Reason: FIXED glitch
 
 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received

pic of MTF_RSI for TOS

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

 
 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received

V2 MULTI TIME FRAME RSI for thinkorswim INDICATOR


declare lower;
###MTF_RSI###5MIN, 10MIN, 15,MIN.//// TREND LINE GREEN AND RED ###
###############################################
input length2 = 4;
input over_Bought2 = 75;
input over_Sold2 = 25;
input averageType2 = AverageType.WILDERS;
input PRICE = close;

###############################################

#######################################################################
def NetChgAvg2 = MovingAverage(averageType2, PRICE - PRICE[1], length2);
def TotChgAvg2 = MovingAverage(averageType2, AbsValue(PRICE - PRICE[1]), length2);
def ChgRatio = if TotChgAvg2 != 0 then NetChgAvg2 / TotChgAvg2 else 0;
##

plot RSI2 = 50 * (ChgRatio + 1);
###plot OverSold30 = over_Sold30;
##plot OverBough30 = over_Bought30;
RSI2.DefineColor("OverBought", Color.GREEN);
RSI2.DefineColor("Normal", GetColor(7));
RSI2.DefineColor("OverSold", Color.LIGHT_RED);
RSI2.AssignValueColor(if RSI2 > over_Bought2 then RSI2.Color("OverBought") else if RSI2 < over_Sold2 then RSI2.Color("OverSold") else RSI2.Color("Normal"));
##OverSold30.SetDefaultColor(GetColor(8));
##OverBough30.SetDefaultColor(GetColor(8));
RSI2.SetLineWeight(4);
#plot Zero = 0;
plot OCHENTA = 500;
#OCHENTA.hide ();
RSI2.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_DOWN);

#############################################
input length30 = 4;
input over_Bought30 = 75;
input over_Sold30 = 25;
input averageType30 = AverageType.WILDERS;

def NetChgAvg30 = MovingAverage(averageType30, close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1], length30);
def TotChgAvg30 = MovingAverage(averageType30, AbsValue(close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1]), length30);
def ChgRatio30 = if TotChgAvg30 != 0 then NetChgAvg30 / TotChgAvg30 else 0;
plot RSI30 = 50 * (ChgRatio30 + 1);
##plot OverSold30 = over_Sold30;
##plot OverBough30 = over_Bought30;
RSI30.DefineColor("OverBought", Color.GREEN);
RSI30.DefineColor("Normal", GetColor(7));
RSI30.DefineColor("OverSold", Color.LIGHT_RED);
RSI30.AssignValueColor(if RSI30 > over_Bought30 then RSI30.Color("OverBought") else if RSI30 < over_Sold30 then RSI30.Color("OverSold") else RSI30.Color("Normal"));
##OverSold30.SetDefaultColor(GetColor(8));
##OverBough30.SetDefaultColor(GetColor(8));
RSI30.SetLineWeight(4);
#plot Zero30 = 0;
RSI30.SetPaintingStrategy(PaintingStrategy.BOOLEAN_WEDGE_UP);

###
input length15 = 4;
input over_Bought15 = 75;
input over_Sold15 = 25;
input averageType15 = AverageType.WILDERS;

def NetChgAvg15 = MovingAverage(averageType15, close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1], length15);
def TotChgAvg15 = MovingAverage(averageType15, AbsValue(close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1]), length15);
def ChgRatio15 = if TotChgAvg15 != 0 then NetChgAvg15 / TotChgAvg15 else 0;
plot RSI15 = 50 * (ChgRatio15 + 1);
#plot OverSold15 = over_Sold15;
#plot OverBough15 = over_Bought15;
RSI15.DefineColor("OverBought", Color.GREEN);
RSI15.DefineColor("Normal", GetColor(7));
RSI15.DefineColor("OverSold", Color.LIGHT_RED);
RSI15.AssignValueColor(if RSI15 > over_Bought15 then RSI15.Color("OverBought") else if RSI15 < over_Sold15 then RSI15.Color("OverSold") else RSI15.Color("Normal"));
#OverSold15.SetDefaultColor(GetColor(8));
#OverBough15.SetDefaultColor(GetColor(8));
RSI15.SetLineWeight(4);
RSI15.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
###
###
input length31 = 4;
input over_Bought31 = 75;
input over_Sold31 = 25;
input averageType31 = AverageType.WILDERS;
def NetChgAvg31 = MovingAverage(averageType31, close(period = AggregationPeriod.FIFTEEN_MIN) - close(period = AggregationPeriod.FIFTEEN_MIN)[1], length30);
def TotChgAvg31 = MovingAverage(averageType31, AbsValue(close(period = AggregationPeriod.FIFTEEN_MIN) - close(period = AggregationPeriod.FIFTEEN_MIN)[1]), length31);
def ChgRatio31 = if TotChgAvg31 != 0 then NetChgAvg31 / TotChgAvg31 else 0;
plot RSI31 = 50 * (ChgRatio31 + 1);
#plot OverSold31 = over_Sold31;
#plot OverBough31 = over_Bought31;
RSI31.DefineColor("OverBought", Color.GREEN);
RSI31.DefineColor("Normal", GetColor(7));
RSI31.DefineColor("OverSold", Color.LIGHT_RED);
RSI31.AssignValueColor(if RSI31 > over_Bought31 then RSI31.Color("OverBought") else if RSI31 < over_Sold31 then RSI31.Color("OverSold") else RSI15.Color("Normal"));
#OverSold31.SetDefaultColor(GetColor(8));
#OverBough31.SetDefaultColor(GetColor(8));
RSI31.SetLineWeight(3);
RSI31.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
##############################################
###############################################
############### RSI 5MIN LINE ################
#input length = 4;
#input over_Bought = 275;
#input over_Sold = 25;
#input averageType = AverageType.WILDERS;

#def NetChgAvg = MovingAverage(averageType, close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1], length);
#def TotChgAvg = MovingAverage(averageType, AbsValue(close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1]), length);
#def ChgRatio5 = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
#plot RSI = 50 * (ChgRatio5 + 1);
#plot OverSold = over_Sold;
#plot OverBough = over_Bought;

#RSI.DefineColor("OverBought", Color.YELLOW);
#RSI.DefineColor("Normal", GetColor(9));
#RSI.DefineColor("OverSold", Color.RED);
#RSI.AssignValueColor(if RSI > over_Bought then RSI.Color("OverBought") else if RSI < over_Sold then RSI.Color("OverSold") else RSI.Color("Normal"));
#OverSold.SetDefaultColor(GetColor(1));
#OverBough.SetDefaultColor(GetColor(1));
#RSI.SetLineWeight(3);
#OverBough.hide ();
#OverSold.hide ();
##############################################
######TREND LINE##############################
###############################################
input fastLengthTrend = 7;#7
input slowLengthTrend = 15;#15
input trendLength = 4;#4
input noiseType = {default linear, squared};
input noiseLength = 250;
input correctionFactor = 2;


Assert(trendLength > 0, "'trend length' must be positive: " + trendLength);
Assert(correctionFactor > 0, "'correction factor' must be positive: " + correctionFactor);

def smf = 2 / (1 + trendLength);

def reversal = TrendPeriods(fastLengthTrend, slowLengthTrend);

def cpc = if IsNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else cpc[1] + close - close[1];

def trend = if IsNaN(reversal[1]) then 0 else if reversal[1] != reversal then 0 else trend[1] * (1 - smf) + cpc * smf;

def noise;
def diff = AbsValue(cpc - trend);
switch (noiseType) {
case linear:
noise = correctionFactor * Average(diff, noiseLength);
case squared:
noise = correctionFactor * Sqrt(Average(diff * diff, noiseLength));
}

plot TQ = if noise == 0 then 0 else trend / noise;
#plot ZeroLine = 0;

TQ.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
TQ.SetLineWeight(3);
TQ.DefineColor("Positive", Color.GREEN);
TQ.DefineColor("Negative", Color.RED);
TQ.AssignValueColor(if TQ > 0 then TQ.Color("Positive") else TQ.Color("Negative"));
#ZeroLine.SetDefaultColor(GetColor(5));
###############################################

 
 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received

V3 Multi_Time Frame RSI for thinkorswim

declare lower;


input length = 4;
input over_Bought = 70;
input over_Sold = 30;
input averageType = AverageType.WILDERS;
def NetChgAvg = MovingAverage(averageType, close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1]), length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
RSI.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);

RSI.DefineColor("OverBought", Color.GREEN);
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", Color.RED);
RSI.AssignValueColor(if RSI > over_Bought then RSI.Color("OverBought") else if RSI < over_Sold then RSI.Color("OverSold") else RSI.Color("Normal"));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
RSI.SetLineWeight (4);
###############################################
input length15 = 4;
input over_Bought15 = 70;
input over_Sold15 = 30;
input averageType15 = AverageType.WILDERS;

def NetChgAvg15 = MovingAverage(averageType15, close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1], length15);
def TotChgAvg15 = MovingAverage(averageType15, AbsValue(close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1]), length15);
def ChgRatio15 = if TotChgAvg15 != 0 then NetChgAvg15 / TotChgAvg15 else 0;
plot RSI15 = 50 * (ChgRatio15 + 1);
#plot OverSold15 = over_Sold15;
#plot OverBought15 = over_Bought15;
RSI15.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

RSI15.DefineColor("OverBought", Color.YELLOW);
RSI15.DefineColor("Normal", GetColor(7));
RSI15.DefineColor("OverSold", Color.RED);
RSI15.AssignValueColor(if RSI15 > over_Bought15 then RSI15.Color("OverBought") else if RSI15 < over_Sold15 then RSI15.Color("OverSold") else RSI15.Color("Normal"));
#OverSold15.SetDefaultColor(GetColor(8));
#OverBought15.SetDefaultColor(GetColor(8));
RSI15.SetLineWeight (3);

###############################################
input length30 = 4;
input over_Bought30 = 70;
input over_Sold30 = 30;
input averageType30 = AverageType.WILDERS;

def NetChgAvg30 = MovingAverage(averageType30, close(period = AggregationPeriod.THIRTY_MIN) - close(period = AggregationPeriod.THIRTY_MIN)[1], length30);
def TotChgAvg30 = MovingAverage(averageType30, AbsValue(close(period = AggregationPeriod.THIRTY_MIN) - close(period = AggregationPeriod.THIRTY_MIN)[1]), length30);
def ChgRatio30 = if TotChgAvg30 != 0 then NetChgAvg30 / TotChgAvg30 else 0;
plot RSI30 = 50 * (ChgRatio30 + 1);
#plot OverSold30 = over_Sold30;
#plot OverBough30 = over_Bought30;
RSI30.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
RSI30.DefineColor("OverBought", Color.GREEN);
RSI30.DefineColor("Normal", GetColor(7));
RSI30.DefineColor("OverSold", Color.RED);
RSI30.AssignValueColor(if RSI30 > over_Bought30 then RSI30.Color("OverBought") else if RSI30 < over_Sold30 then RSI30.Color("OverSold") else RSI30.Color("Normal"));
#OverSold30.SetDefaultColor(GetColor(8));
#OverBough30.SetDefaultColor(GetColor(8));
RSI30.SetLineWeight (3);
##################################################
############ HOUR #############################
input lengthh = 4;
input over_Boughth = 70;
input over_Soldh = 30;
input averageTypeh = AverageType.WILDERS;

#def NetChgAvgh = MovingAverage(averageTypeh, close(period = AggregationPeriod.hour) - close(period = AggregationPeriod.hour)[1], lengthh);
#def TotChgAvgh = MovingAverage(averageTypeh, AbsValue(close(period = AggregationPeriod.thirty_min) - close(period = AggregationPeriod.thirty_min)[1]), lengthh);

input price = close;

def NetChgAvgh = MovingAverage(averageType, price - price[1], length);
def TotChgAvgh = MovingAverage(averageType, AbsValue(price - price[1]), length);



def ChgRatioh = if TotChgAvgh != 0 then NetChgAvgh / TotChgAvgh else 0;
plot RSIh = 50 * (ChgRatioh + 1);
plot OverSoldh = over_Soldh;
plot OverBoughh = over_Boughth;
RSIh.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

RSIh.DefineColor("OverBought", Color.GREEN);
RSIh.DefineColor("Normal", GetColor(7));
RSIh.DefineColor("OverSold", Color.RED);
RSIh.AssignValueColor(if RSIh > over_Boughth then RSIh.Color("OverBought") else if RSIh < over_Soldh then RSIh.Color("OverSold") else RSIh.Color("Normal"));
#OverSold30.SetDefaultColor(GetColor(8));
#OverBough30.SetDefaultColor(GetColor(8));
RSIh.SetLineWeight (5);
plot DL = 10;
DL.HideBubble();
DL.SetDefaultColor(Color.WHITE);
DL.SetLineWeight(3);

 
 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received

MTF RSI_CCI INDICATOR

######RSI_MTFs_CCI########
declare lower;

input length = 4;
input over_Bought = 50;#70
input over_Sold = 20;
input price = close;
input averageType = AverageType.WILDERS;

def NetChgAvg = MovingAverage(averageType, price - price[1], length);
def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);

def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
plot RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;
RSI.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

RSI.DefineColor("OverBought", color.green);
RSI.DefineColor("Normal", color.pink);
RSI.DefineColor("OverSold", Color.RED);
#RSI.AssignValueColor(if RSI > over_Bought then RSI.Color("OverBought") else if RSI < over_Sold then RSI.Color("OverSold") else RSI.Color("Normal"));
RSI.AssignValueColor(if RSI > over_Bought then RSI.Color("OverBought") else if RSI < over_Sold then RSI.Color("OverSold") else RSI.Color("Normal"));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));
RSI.SetLineWeight (5);

#plot DL = 100;
#DL.HideBubble();
#DL.SetDefaultColor(Color.WHITE);
#DL.SetLineWeight(1);

###############5MIN##############################################
#input averageType = AverageType.WILDERS;
def NetChgAvg5 = MovingAverage(averageType, close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1], length);
def TotChgAvg5 = MovingAverage(averageType, AbsValue(close(period = AggregationPeriod.FIVE_MIN) - close(period = AggregationPeriod.FIVE_MIN)[1]), length);

def ChgRatio5 = if TotChgAvg5 != 0 then NetChgAvg5 / TotChgAvg5 else 0;
plot RSI5 = 50 * (ChgRatio + 1);
plot OverSold5 = over_Sold;
plot OverBought5 = over_Bought;
RSI5.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);

RSI5.DefineColor("OverBought", GetColor(6));
RSI5.DefineColor("Normal", color.pink);#CreateColor(192, 192, 208));
RSI5.DefineColor("OverSold", Color.RED);
RSI5.AssignValueColor(if RSI5 > over_Bought then RSI5.Color("OverBought") else if RSI5 < over_Sold then RSI5.Color("OverSold") else RSI5.Color("Normal"));
RSI5.SetLineWeight (5);

###############################################
###########################10MIN###############
input length15 = 4;
input over_Bought15 = 70;
input over_Sold15 = 30;
input averageType15 = AverageType.WILDERS;

def NetChgAvg15 = MovingAverage(averageType15, close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1], length15);
def TotChgAvg15 = MovingAverage(averageType15, AbsValue(close(period = AggregationPeriod.TEN_MIN) - close(period = AggregationPeriod.TEN_MIN)[1]), length15);

def ChgRatio15 = if TotChgAvg15 != 0 then NetChgAvg15 / TotChgAvg15 else 0;
plot RSI15 = 50 * (ChgRatio15 + 1);
#plot OverSold15 = over_Sold15;
#plot OverBought15 = over_Bought15;
RSI15.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
RSI15.DefineColor("OverBought", Color.green);
DefineGlobalColor("FillColor", color.pink);#CreateColor(192, 192, 208));


RSI15.DefineColor("Normal", GlobalColor("FillColor" ));#GetColor(7));
RSI15.DefineColor("OverSold", Color.RED);
RSI15.AssignValueColor(if RSI15 > over_Bought15 then RSI15.Color("OverBought") else if RSI15 < over_Sold15 then RSI15.Color("OverSold") else RSI15.Color("Normal"));
#OverSold15.SetDefaultColor(GetColor(8));
#OverBought15.SetDefaultColor(GetColor(8));
RSI15.SetLineWeight (2);

###############################################
input length30 = 4;
input over_Bought30 = 70;
input over_Sold30 = 30;
input averageType30 = AverageType.WILDERS;

def NetChgAvg30 = MovingAverage(averageType30, close(period = AggregationPeriod.THIRTY_MIN) - close(period = AggregationPeriod.THIRTY_MIN)[1], length30);
def TotChgAvg30 = MovingAverage(averageType30, AbsValue(close(period = AggregationPeriod.THIRTY_MIN) - close(period = AggregationPeriod.THIRTY_MIN)[1]), length30);
def ChgRatio30 = if TotChgAvg30 != 0 then NetChgAvg30 / TotChgAvg30 else 0;
plot RSI30 = 50 * (ChgRatio30 + 1);
###plot OverSold30 = over_Sold30;
###plot OverBough30 = over_Bought30;
RSI30.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
RSI30. Hide ();
RSI30.DefineColor("OverBought", Color.green);
RSI30.DefineColor("Normal", color.pink);#GetColor(7));
RSI30.DefineColor("OverSold", Color.RED);
RSI30.AssignValueColor(if RSI30 > over_Bought30 then RSI30.Color("OverBought") else if RSI30 < over_Sold30 then RSI30.Color("OverSold") else RSI30.Color("Normal"));
###OverSold30.SetDefaultColor(GetColor(8));
###OverBough30.SetDefaultColor(GetColor(8));
RSI30.SetLineWeight (5);


##################################################
############ HOUR #############################
#input lengthh = 4;
#input over_Boughth = 70;
#input over_Soldh = 30;
#input averageTypeh = AverageType.WILDERS;

#input price = close;

#def NetChgAvgh = MovingAverage(averageType, price - price[1], length);
#def TotChgAvgh = MovingAverage(averageType, AbsValue(price - price[1]), length);

#def ChgRatioh = if TotChgAvgh != 0 then NetChgAvgh / TotChgAvgh else 0;
#plot RSIh = 50 * (ChgRatioh + 1);
#plot OverSoldh = over_Soldh;
#plot OverBoughh = over_Boughth;
#RSIh.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

#RSIh.DefineColor("OverBought", Color.GREEN);
#RSIh.DefineColor("Normal", GetColor(7));
#RSIh.DefineColor("OverSold", Color.RED);
#RSIh.AssignValueColor(if RSIh > over_Boughth then RSIh.Color("OverBought") else if RSIh < over_Soldh then RSIh.Color("OverSold") else RSIh.Color("Normal"));
###OverSold30.SetDefaultColor(GetColor(8));
###OverBough30.SetDefaultColor(GetColor(8));
#RSIh.SetLineWeight (5);



##################################################################
#######################CCI#######################################
input lengthCCI = 14;#14
input over_soldCCI = -100;
input over_boughtCCI = 100;


def priceCCI = close + low + high;
def linDev = LinDev(priceCCI, lengthCCI);
plot CCI = if linDev == 0 then 0 else (priceCCI - Average(priceCCI, lengthCCI)) / linDev / 0.015;
plot OverBoughtCCI = over_boughtCCI;
plot ZeroLine = -0;
plot OverSoldCCI = over_soldCCI;
plot UpSignal = if Crosses(CCI, ZeroLine, CrossingDirection.ABOVE) then ZeroLine else Double.NaN;
plot DownSignal = if Crosses(CCI, over_boughtCCI, CrossingDirection.BELOW) then ZeroLine else Double.NaN;

CCI.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

CCI.SetDefaultColor(GetColor(9));
CCI.DefineColor("OverBought",GetColor(6));
CCI.DefineColor("Normal", GetColor(7));
CCI.DefineColor("OverSold", Color.RED);
#CCI.AssignValueColor(if CCI > over_soldCCI then CCI.Color("OverBought") else if CCI < over_boughtCCI then CCI.Color("OverSold") else CCI.Color("Normal"));
CCI.AssignValueColor(if CCI > ZeroLine then CCI.Color("OverBought") else if CCI < ZeroLine then CCI.Color("OverSold") else CCI.Color("Normal"));

OverSoldCCI.SetDefaultColor(GetColor(8));
OverBoughtCCI.SetDefaultColor(GetColor(8));
CCI.SetLineWeight (1);

OverBoughtCCI.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(4));
OverSoldCCI.SetDefaultColor(GetColor(5));



###############################################################

 
 
NY, NY
 
 
Posts: 64 since Dec 2011
Thanks: 27 given, 16 received

Hi alagrande,

Thanks for your recent posts and sharing the interesting scripts. I've been trying them out, but can only get them working on a 5 min chart. Any chance of getting them to work on longer timeframes with longer aggregations? I swingtrade more than I daytrade...

Thanks in advance...

Regards,

netarchitech

P.S. - The "FORCE RSI SQUEEZE" indicator in the accompanying image looked very interesting as well. Any chance you might share the script for that?

 
 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received


netarchitech View Post
Hi alagrande,

Thanks for your recent posts and sharing the interesting scripts. I've been trying them out, but can only get them working on a 5 min chart. Any chance of getting them to work on longer timeframes with longer aggregations? I swingtrade more than I daytrade...

Thanks in advance...

Regards,

netarchitech

P.S. - The "FORCE RSI SQUEEZE" indicator in the accompanying image looked very interesting as well. Any chance you might share the script for that?

If you want to change to higher time frames... you can change THAT IN the script for EXAMPLE... FIVE_MIN to HOUR, TWO_HOURS ETC... DAY, TWO_DAYS ETC...

HERE is the code for the FORCE_RSI_SQUEEZE

DECLARE LOWER;
## ### ### FORCE_RSI_SQUEEZE ### ####
##PERCENT WILLIAM RSI ### ###
###########################
input lengthPercent = 30;
input over_BoughtPercent = -20;
input over_SoldPercent = -80;
input price = close;
input averageTypePercent = AverageType.WILDERS;
#William

def hh = Highest(high, lengthPercent);
def ll = Lowest(low, lengthPercent);
def result = if hh == ll then -100 else (hh - close) / (hh - ll) * (-100);

plot WR = if result > 0 then 0 else result;
WR.SetDefaultColor(GetColor(1));

#end william ### ##########################


#def NetChgAvg = MovingAverage(averageType, price - price[1], length);
#def TotChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
#def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;

#plot RSI = 50 * (ChgRatio + 1);
plot OverSoldPercent = over_SoldPercent;
plot OverBoughtPercent = over_BoughtPercent;

WR.DefineColor("OverBought", GetColor(4));
WR.DefineColor("Normal", GetColor(7));
WR.DefineColor("OverSold", GetColor(0));
WR.AssignValueColor(if WR > over_BoughtPercent then WR.color("OverBought") else if WR < over_SoldPercent
then WR.color("OverSold") else WR.color("Normal"));
OverSoldPercent.SetDefaultColor(GetColor(8));
OverBoughtPercent.SetDefaultColor(GetColor(8));
WR. setLineWeight (5);

#### ##### ###### ########
##CCI ### ########
input lengthCCI = 24;
input over_sold = -100;
input over_bought = 100;

def priceCCI = close + low + high;
def linDev = lindev(price, lengthCCI);
plot CCI = if linDev == 0 then 0 else (price - Average(price, lengthCCI)) / linDev / 0.015;

CCI.SetDefaultColor(GetColor(0));

###FORCE##################################################
#input length = 13;
#ZeroLine.SetDefaultColor(GetColor(8));
###FORCE## ## //////////////////////
input length = 13;
input colorNormLength2 = 14;#14
plot FI = ExpAverage(data = (close - close[1]) * volume, length);
FI.SetDefaultColor(GetColor(8));
plot ZeroLine = 0;
ZeroLine.SetDefaultColor(GetColor(2));
plot ZeroLine2 = 0;
ZeroLine2.SetDefaultColor(GetColor(3));
FI.setlineWeight (4);
plot ZeroLine3 = 400;
ZeroLine3.SetDefaultColor(GetColor(0));
#plot ZeroLine4 = 5000;
#ZeroLine4.SetDefaultColor(GetColor(5));
#####price gradient ### #####
FI.DefineColor("Highest", Color.YELLOW);
FI.DefineColor("Lowest", Color.RED);
FI.AssignNormGradientColor(colorNormLength2, FI.Color("Lowest"), FI.Color("Highest"));
FI.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

#################
#SQUEEZ## ## ###
plot Outsqueeze = if (reference BollingerBands()."upperband" - KeltnerChannels()."upper_band”) <= 0 then 4 else Double.NaN;
Outsqueeze.HideBubble();
Outsqueeze.SetPaintingStrategy (PaintingStrategy.POINTS);
Outsqueeze.SetDefaultColor(Color.GREEN);
Outsqueeze.SetLineWeight (2);
Outsqueeze.AssignValueColor(if Outsqueeze < 0 then Color.WHITE else Color.WHITE);



#METER###FOR FORCE############################################
AddLabel (yes, "force", Color.CYAN);
input ShowADXValue = {DoNotShow, OnLeft, default OnRight};
input DisplayStrengthMeter = {"No", default "Yes"};
input FixedValueBkgndColor = {default "No", "Yes"};


def ADX = DMI(length).ADX;
def DIBull = DIPlus(length);
def DIBear = DIMinus(length);

def BullishTrend = DIBull >= DIBear;

def ShowDigits;

switch (ShowADXValue)
{
case DoNotShow:
ShowDigits = 0;
case OnLeft:
ShowDigits = 1;
case OnRight:
ShowDigits = 2;
}


#if DI+ > DI- then trend is bullish
#if DI- > DI+ then trend is bearish
#if ADI >= 20 then market is trending

def HighlightColor =
if (ADX >= 50) then 51 else
if (ADX >= 40 and ADX < 50) then 51 else
if (ADX >= 30 and ADX < 40) then 102 else
if (ADX >= 20 and ADX < 30) then 153 else
if (ADX >= 10 and ADX < 20) then 204 else
255;


# default background color for ADX value label. Can be changed via study settings
# sadly, I've some sort of color limitation bug in TOS scritping. To change the
# background color, you'll need to modify the RGB values below, which means that
# you unfortunately can't have a different background color for different charts.
def ADXBkgndValueR = 25;
def ADXBkgndValueG = 25;
def ADXBkgndValueB = 25;


AddLabel(FixedValueBkgndColor and ShowDigits == 1, Floor(ADX), CreateColor(ADXBkgndValueR, ADXBkgndValueG, ADXBkgndValueB));

AddLabel(!FixedValueBkgndColor and ShowDigits == 1, Floor(ADX), CreateColor(if !BullishTrend then 255 else HighlightColor, if !BullishTrend then HighlightColor else 255 , 51));

AddLabel(DisplayStrengthMeter and !BullishTrend and (ADX >= 50), " ", CreateColor(255, HighlightColor, 51));
AddLabel(DisplayStrengthMeter and !(!BullishTrend and (ADX >= 50)), " ", CreateColor(77, 0, 25));

AddLabel(DisplayStrengthMeter and !BullishTrend and (ADX >= 40 and ADX < 50), " ", CreateColor(255, HighlightColor, 51));
AddLabel(DisplayStrengthMeter and !(!BullishTrend and (ADX >= 40 and ADX < 50)), " ", CreateColor(77, 0, 0));

AddLabel(DisplayStrengthMeter and !BullishTrend and (ADX >= 30 and ADX < 40), " ", CreateColor(255, HighlightColor, 51));
AddLabel(DisplayStrengthMeter and !(!BullishTrend and (ADX >= 30 and ADX < 40)), " ", CreateColor(77, 25, 0));

AddLabel(DisplayStrengthMeter and !BullishTrend and (ADX >= 20 and ADX < 30), " ", CreateColor(255, HighlightColor, 51));
AddLabel(DisplayStrengthMeter and !(!BullishTrend and (ADX >= 20 and ADX < 30)), " ", CreateColor(77, 51, 0));

#
AddLabel(DisplayStrengthMeter and !BullishTrend and (ADX >= 10 and ADX < 20), " ", CreateColor(255, HighlightColor, 51));
AddLabel(DisplayStrengthMeter and !(!BullishTrend and (ADX >= 10 and ADX < 20)), " ", CreateColor(77, 77, 0));

AddLabel(DisplayStrengthMeter and ADX < 10, " ", CreateColor(255, HighlightColor, 51));
AddLabel(DisplayStrengthMeter and ADX > 10, " ", CreateColor(77, 77, 0));

AddLabel(DisplayStrengthMeter and BullishTrend and (ADX >= 10 and ADX < 20), " ", CreateColor(HighlightColor, 255, 51));
AddLabel(DisplayStrengthMeter and !(BullishTrend and (ADX >= 10 and ADX < 20)), " ", CreateColor(77, 77, 0));
#

AddLabel(DisplayStrengthMeter and BullishTrend and (ADX >= 20 and ADX < 30), " ", CreateColor(HighlightColor, 255, 51));
AddLabel(DisplayStrengthMeter and !(BullishTrend and (ADX >= 20 and ADX < 30)), " ", CreateColor(51, 77, 0));

AddLabel(DisplayStrengthMeter and BullishTrend and (ADX >= 30 and ADX < 40), " ", CreateColor(HighlightColor, 255, 51));
AddLabel(DisplayStrengthMeter and !(BullishTrend and (ADX >= 30 and ADX < 40)), " ", CreateColor(25, 77, 0));

AddLabel(DisplayStrengthMeter and BullishTrend and (ADX >= 40 and ADX < 50), " ", CreateColor(HighlightColor, 255, 51));
AddLabel(DisplayStrengthMeter and !(BullishTrend and (ADX >= 40 and ADX < 50)), " ", CreateColor(0, 77, 0));

AddLabel(DisplayStrengthMeter and BullishTrend and ADX >= 50, " ", CreateColor(HighlightColor, 255, 51));
AddLabel(DisplayStrengthMeter and !(BullishTrend and ADX >= 50), " ", CreateColor(0, 77, 25));

AddLabel(FixedValueBkgndColor and ShowDigits == 2, Floor(ADX), CreateColor(ADXBkgndValueR, ADXBkgndValueG, ADXBkgndValueB));

AddLabel(!FixedValueBkgndColor and ShowDigits == 2, Floor(ADX), CreateColor(if !BullishTrend then 255 else HighlightColor, if !BullishTrend then HighlightColor else 255 , 51));


Last edited by alagrande; December 15th, 2017 at 12:35 AM. Reason: ADD TEXT
The following user says Thank You to alagrande for this post:
 
 
NY, NY
 
 
Posts: 64 since Dec 2011
Thanks: 27 given, 16 received

Hi again alagrande,

Thank you for the swift response and generously including the Force script

Per you suggestion, I tried switching the aggregations to longer periods, but the indicator is blank in the chart window no matter what I do unless I switch back to the 5 min chart

Any thoughts?

Thanks again...

Regards,

netarchitech

The following user says Thank You to netarchitech for this post:
 
 
Legendary Market Wizard
Chicago Illinois USA
 
Trading Experience: Advanced
Broker/Data: IB, ToS
Favorite Futures: /ES, US Equities/Options
 
wldman's Avatar
 
Posts: 3,024 since Aug 2011
Thanks: 1,667 given, 6,595 received

Hey man...

Thank you for posting ToS indicators. I feel like I'm stuck there at ToS because I do not love their charts. The general body of indicator work seems clunky, non intuitive and king of boring.

I'd love it if ToS had a rich and valuable following of capable script makers.

Dan

Visit my futures io Trade Journal
 
 
glendale ca usa
 
 
Posts: 50 since Sep 2017
Thanks: 2 given, 42 received



netarchitech View Post
Hi again alagrande,

Thank you for the swift response and generously including the Force script

Per you suggestion, I tried switching the aggregations to longer periods, but the indicator is blank in the chart window no matter what I do unless I switch back to the 5 min chart

Any thoughts?

Thanks again...

Regards,

netarchitech

Hi, your (the particular time chart you are planing to use) working time chart should be < then your minimum aggregation time in the script.

The following user says Thank You to alagrande for this post:

 



futures io > > > > MTF_RSI for THINKORSWIM
Thread Tools



Upcoming Webinars and Events (4:30PM ET unless noted)
 

futures io is celebrating 10-years w/ over $18,000 in prizes!

Right now
 

$250 Amazon Gift Cards with our "Thanks Contest" challenge!

Right now
 

Using Order Flow Analysis & Longer Term Trading w/John @ No BS Trading

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
VSA for ThinkorSwim cbritton ThinkOrSwim Programming 433 January 4th, 2020 10:06 PM
Why do you use ThinkOrSwim? Big Mike ThinkOrSwim 44 December 13th, 2019 02:36 PM
thinkorswim so restrict sibullsibear Traders Hideout 1 December 5th, 2016 12:23 AM
Thinkorswim steve2222 Terms (Glossary) 0 February 17th, 2016 09:10 AM
From StartegyDesk to ThinkorSwim moonshadow ThinkOrSwim 15 March 19th, 2012 10:51 PM


All times are GMT -4. The time now is 04:17 PM. (this page content is cached, log in for real-time version)

Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts