PRICE_RSI_OSC for TOS - futures io
futures io futures trading



PRICE_RSI_OSC for TOS


Discussion in ThinkOrSwim

Updated
    1. trending_up 498 views
    2. thumb_up 2 thanks given
    3. group 1 followers
    1. forum 0 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

PRICE_RSI_OSC for TOS

(login for full post details)
  #1 (permalink)
glendale ca usa
 
 
Posts: 97 since Sep 2017
Thanks: 11 given, 87 received

#PRICE_RSI_OSC
declare lower;


input length30 = 24;

input over_Bought30 = 70;

input over_Sold30 = 30;


input averageType30 = AverageType.WILDERS;

def NetChgAvg30 = MovingAverage(averageType30, close - close[1], length30);
def TotChgAvg30 = MovingAverage(averageType30, AbsValue(close - close[1]), length30);
def ChgRatio30 = if TotChgAvg30 != 0 then NetChgAvg30 / TotChgAvg30 else 0;
plot RSI30 = 50 * (ChgRatio30 + 1);
#plot OverSold30 = over_Sold30;
#plot


RSI30.DefineColor("OverBought", Color.RED);

RSI30.DefineColor("Normal", GetColor(8));

RSI30.DefineColor("OverSold", Color.CYAN);

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(1);


plot linea = 50;
linea.SetStyle (Curve.LONG_DASH);
linea.SetDefaultColor(Color.GRAY);
#============================================

#declare lower;

input length = 24;
input over_Bought = 70;
input over_Sold = 30;
input price = close;
input averageType = AverageType.WILDERS;
input RSI_smoothing_averageType = AverageType.exponential;
input RSI_smoothing_length = 10;

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;

def RSI = 50 * (ChgRatio + 1);
plot OverSold = over_Sold;
plot OverBought = over_Bought;

plot RSI_moving_average = MovingAverage(RSI_smoothing_averageType, RSI, RSI_smoothing_length);

RSI_moving_average.DefineColor("OverBought", GetColor(5));
RSI_moving_average.DefineColor("Normal", GetColor(7));
RSI_moving_average.DefineColor("OverSold", GetColor(1));
RSI_moving_average.AssignValueColor(if RSI > over_Bought then RSI_moving_average.color("OverBought") else if RSI < over_Sold then RSI_moving_average.color("OverSold") else RSI_moving_average.color("Normal"));
OverSold.SetDefaultColor(GetColor(8));
OverBought.SetDefaultColor(GetColor(8));

addcloud(RSI30, RSI_moving_average, color.green, color.red);

#plot UpSignal = if RSI < RSI_moving_average and RSI_moving_average<50 then OverSold else Double.NaN;
#plot DownSignal = if RSI > RSI_moving_average and RSI_moving_average>50 then OverBought else Double.NaN;



##==================================================

#input price = close;
input length2 = 14;
input length3 = 5;
input RSI_smoothing_length2 = 3;
input RSI_smoothing_averageType2 = AverageType.exponential;

def CP = ExpAverage(Sign(price - price[1]) * price, length2);
def TC = ExpAverage(price, length2);

#def PZO = 90 * CP / TC+50;
def PZO = 30 * CP / TC+50;


plot RSI_moving_average2 = MovingAverage(RSI_smoothing_averageType2, PZO, RSI_smoothing_length2);
RSI_moving_average2.setDefaultColor(color.magenta);

plot P = WildersSmoothing(PZO, length3);
P.setDefaultColor(color.white);
addcloud(RSI_moving_average2, P, color.green, color.red);


plot UpSignal = if RSI < RSI_moving_average and RSI_moving_average<50 then 70 else Double.NaN;
plot DownSignal = if RSI > RSI_moving_average and RSI_moving_average>50 then 70 else Double.NaN;


UpSignal.SetDefaultColor(Color.RED);
UpSignal.SetPaintingStrategy(PaintingStrategy.SQUARES);
UpSignal.setLineWeight(2);
DownSignal.SetDefaultColor(Color.DARK_GREEN);
DownSignal.SetPaintingStrategy(PaintingStrategy.SQUARES);
DownSignal.setLineWeight(2);
#=====
#plot UpSignal2 = if RSI_moving_average2 < P then OverSold else Double.NaN;
#plot DownSignal2 = if RSI_moving_average2 > P then OverBought else Double.NaN;
plot UpSignal2 = if RSI_moving_average2 < P then 70 else Double.NaN;
plot DownSignal2 = if RSI_moving_average2 > P then 70 else Double.NaN;


UpSignal2.SetDefaultColor(Color.YELLOW);
UpSignal2.SetPaintingStrategy(PaintingStrategy.SQUARES);
UpSignal2.setLineWeight(4);
DownSignal2.SetDefaultColor(Color.GREEN);
DownSignal2.SetPaintingStrategy(PaintingStrategy.SQUARES);
DownSignal2.setLineWeight(4);



#plot linea2 = 10;
#linea2.SetStyle (Curve.LONG_DASH);
#linea2.SetDefaultColor(Color.GRAY);
#=================================

Reply With Quote
The following 2 users say Thank You to alagrande for this post:


futures io Trading Community Platforms and Indicators ThinkOrSwim > PRICE_RSI_OSC for TOS


Last Updated on September 23, 2018


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 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