StockFetcher Forums · Filter Exchange · Thinkorswim indicators multiple instruments<< 1 2 >>Post Follow-up
guspenskiy13
976 posts
msg #122309
Ignore guspenskiy13
12/18/2014 5:32:41 PM

Plugged in this filter into thinkscript:

Fetcher[set{relstrength, roc(11,1) - ind(iwm, roc(11,1))}

symlist(TNA,TZA,UPRO,UVXY,TQQQ,SQQQ,DUST,NUGT)
add column Volume 1 day ago {Vol 1 day ago}
ADD COLUMN SEPARATOR
add column rsi(2) 1 day ago { RSI(2) 1 day ago}
add column rsi(2)
ADD COLUMN relstrength {relative strength}

SORT ON COLUMN 9 DESCENDING
do not draw relstrength
do not draw RSI(7)
do not draw RSI(2)
do not draw Money Flow Index(5)
do not draw Williams %R(20)
draw ind(tqqq, relstrength) on plot ind(sqqq, relstrength)
draw ind(tqqq, rsi(7)) on plot ind(sqqq, rsi(7))
draw ind(tqqq,money flow index(5)) on plot ind(sqqq, money flow index(5))
draw ind(tqqq, Williams %R(20)) on plot ind(sqqq, Williams %R(20))
draw CMA(RSI(2), 5)
]



Double RSI:


declare lower;

input symbol = "VXX";
input length2 = 14;
input over_Bought2 = 70;
input over_Sold2 = 30;
input averageType2 = AverageType.WILDERS;
input price2 = FundamentalType.CLOSE;
def price1 = Fundamental(price2, symbol);
def NetChgAvg2 = MovingAverage(averageType2, price1 - price1[1], length2);
def TotChgAvg2 = MovingAverage(averageType2, AbsValue(price1 - price1[1]), length2);
def ChgRatio2 = if TotChgAvg2 != 0 then NetChgAvg2 / TotChgAvg2 else 0;

plot RSI2 = 50 * (ChgRatio2 + 1);
plot OverSold2 = over_Sold2;
plot OverBought2 = over_Bought2;

RSI2.DefineColor("OverBought", GetColor(5));
RSI2.DefineColor("Normal", GetColor(7));
RSI2.DefineColor("OverSold", GetColor(1));
RSI2.AssignValueColor(if RSI2 > over_Bought2 then RSI2.Color("OverBought") else if RSI2 < over_Sold2 then RSI2.Color("OverSold") else RSI2.Color("Normal"));
OverSold2.SetDefaultColor(GetColor(8));
OverBought2.SetDefaultColor(GetColor(8));


input length = 14;
input over_Bought = 70;
input over_Sold = 30;
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.DefineColor("OverBought", GetColor(5));
RSI.DefineColor("Normal", GetColor(7));
RSI.DefineColor("OverSold", GetColor(1));
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));

_____________________________________________________________________________
Double R%:

declare lower;
input symbol = "VXX";
input price = FundamentalType.CLOSE;
def price1 = Fundamental(price, symbol);
input length2 = 10;
input overBought2 = -20;
input overSold2 = -80;

def hh2 = Highest(high(symbol), length2);
def ll2 = Lowest(low(symbol), length2);
def result2 = if hh2 == ll2 then -100 else (hh2 - close(symbol)) / (hh2 - ll2) * (-100);

plot WR2 = if result2 > 0 then 0 else result2;
WR2.SetDefaultColor(GetColor(1));

plot Over_Sold2 = overSold2;
Over_Sold2.SetDefaultColor(GetColor(8));

plot Over_Bought2 = overBought2;
Over_Bought2.SetDefaultColor(GetColor(8));



input length = 10;
input overBought = -20;
input overSold = -80;

def hh = Highest(high, length);
def ll = Lowest(low, length);
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));

plot Over_Sold = overSold;
Over_Sold.SetDefaultColor(GetColor(8));

plot Over_Bought = overBought;
Over_Bought.SetDefaultColor(GetColor(8));

_____________________________________________________________________________
Double CCI:

declare lower;
input symbol = "VXX";

input length2 = 14;
input over_sold2 = -100;
input over_bought2 = 100;

def price2 = close(symbol) + low(symbol) + high(symbol);
def linDev2 = lindev(price2, length2);
plot CCI2 = if linDev2 == 0 then 0 else (price2 - Average(price2, length2)) / linDev2 / 0.015;
plot OverBought2 = over_bought2;
plot ZeroLine2 = 0;
plot OverSold2 = over_sold2;

CCI2.setDefaultColor(GetColor(9));
OverBought2.setDefaultColor(GetColor(5));
ZeroLine2.setDefaultColor(GetColor(5));
OverSold2.setDefaultColor(GetColor(5));

input length = 14;
input over_sold = -100;
input over_bought = 100;

def price = close + low + high;
def linDev = lindev(price, length);
plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
plot OverBought = over_bought;
plot ZeroLine = 0;
plot OverSold = over_sold;

CCI.setDefaultColor(GetColor(9));
OverBought.setDefaultColor(GetColor(5));
ZeroLine.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));

Eman93
4,750 posts
msg #122311
Ignore Eman93
12/19/2014 4:28:37 AM

Close but you want to plot the RSI of VXX on XIV... they way i read it you are not getting the other symbol to plot over each other.

Mactheriverrat
3,135 posts
msg #122312
Ignore Mactheriverrat
12/19/2014 6:05:28 AM

just another idea.
Add the EMA(13)
chart-time 7 months.


--------
Price above ema(13) bullish.
Price below ema(13) bearish

guspenskiy13
976 posts
msg #122314
Ignore guspenskiy13
12/19/2014 9:11:29 AM

Eman,

these indicators plot two things:

1) the indicator of the instrument you have on the chart (let's say XIV for example).

2) the indicator of the instrument you plug in as "symbol".

So it should do the work.

P.S.

Found a quite interesting relationship between XIV and the index of volatility for volatility "VVIX".

guspenskiy13
976 posts
msg #122315
Ignore guspenskiy13
12/19/2014 9:13:15 AM

Mactheriverrat,

do you want to paint the bars according to the position of price in comparison to EMA(13)? Didn't quite get it.

If anyone has interesting ideas to incorporate, I'm always glad to help....although I'm no ToS scripter of course ;)

Mactheriverrat
3,135 posts
msg #122321
Ignore Mactheriverrat
12/20/2014 3:26:29 AM

I try to keep filter's simple not have a lot of indicators
To me ema(13) with price above or below is trend sign.
IMHO.

Eman93
4,750 posts
msg #122335
Ignore Eman93
12/22/2014 8:00:48 AM

Got it thanks


guspenskiy13
976 posts
msg #122337
Ignore guspenskiy13
12/22/2014 10:03:25 AM

Mactheriverrat,

just use ToS "PriceAverageCrossover". It will paint an arrow for each cross of price with any type of average.

guspenskiy13
976 posts
msg #122338
Ignore guspenskiy13
modified
12/22/2014 10:10:36 AM

For those, who find a relationship of VIX/SPX interesting.

The crossover of the ratio with MA sometimes could be very choppy...so this is an alternative... a histogram difference of the ratio with its MA....

Could also be used as an alternative to BB's - find extreme points by the extreme difference with MA....could also be used for any other two symbols...

declare lower;

input price = FundamentalType.CLOSE;
input SPY = "SPX";
input VXX = "VIX";
input length = 9;
input displace = 0;
input crossingType = {default above, below};

def price1 = Fundamental(price, SPY);
def price2 = Fundamental(price, VXX);

plot Relation = if price2 == 0 then Double.NaN else price2 / price1;
Relation.SetDefaultColor(GetColor(1));

plot Avg = Average(Relation[-displace], length);
Avg.SetDefaultColor(GetColor(5));

plot Diff = Relation - Avg;

Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.SetLineWeight(3);
Diff.DefineColor("Positive and Up", Color.GREEN);
Diff.DefineColor("Positive and Down", Color.DARK_GREEN);
Diff.DefineColor("Negative and Down", Color.RED);
Diff.DefineColor("Negative and Up", Color.DARK_RED);
Diff.AssignValueColor(if Diff <= 0 then if Diff < Diff[1] then Diff.Color("Positive and Up") else Diff.Color("Positive and Down") else if Diff > Diff[1] then Diff.Color("Negative and Down") else Diff.Color("Negative and Up"));

avg.hide();
relation.hide();




guspenskiy13
976 posts
msg #122339
Ignore guspenskiy13
12/22/2014 1:46:57 PM

I like using long period CCI as a histogram to spot possible support/resistance/trend breaks...
Image and video hosting by TinyPic

declare lower;

input length = 14;
input over_sold = -100;
input over_bought = 100;

def price = close + low + high;
def linDev = LinDev(price, length);
plot CCI = if linDev == 0 then 0 else (price - Average(price, length)) / linDev / 0.015;
plot OverBought = over_bought;
plot ZeroLine = 0;
plot OverSold = over_sold;

CCI.SetDefaultColor(GetColor(9));
OverBought.SetDefaultColor(GetColor(5));
ZeroLine.SetDefaultColor(GetColor(5));
OverSold.SetDefaultColor(GetColor(5));

CCI.SetDefaultColor(GetColor(5));
CCI.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
CCI.SetLineWeight(3);
CCI.DefineColor("Positive and Up", Color.GREEN);
CCI.DefineColor("Positive and Down", Color.DARK_GREEN);
CCI.DefineColor("Negative and Down", Color.RED);
CCI.DefineColor("Negative and Up", Color.DARK_RED);
CCI.AssignValueColor(if CCI >= 0 then if CCI > CCI[1] then CCI.color("Positive and Up") else CCI.color("Positive and Down") else if CCI < CCI[1] then CCI.color("Negative and Down") else CCI.color("Negative and Up"));

StockFetcher Forums · Filter Exchange · Thinkorswim indicators multiple instruments<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.