In, @martinflds . TYVM...
Hi @BenTen , You may want to move that Google Drive to the Tutorials and pin it. Would that work better? Just wondering. Take care!Thank you for sharing. Please enable the share settings in Google Drive so that we don't have to request for permission to view the document.
Big duh! on my part, thanks@markos I thought it would suitable here since that Google Drive is a compilation of ToS resources similar to what we already have here. Hope you're doing well.
#thinkscript indicator : OCHLO_levels
#It draws yesterday High, Low, Open, Close support and resistance line
#by thetrader.top
input sPeroid = {default DAY, WEEK, MONTH};
input iHigh = {default “yes”, “no”};
input iLow = {default “yes”, “no”};
input iClose = {default “yes”, “no”};
input iOpen = {default “yes”, “no”};
input iTodayOpen = {default “yes”, “no”};
plot pHigh = if !iHigh then high(period = sPeroid)[1] else Double.NaN;
plot pLow = if !iLow then low(period = sPeroid)[1] else Double.NaN;
plot pClose = if !iClose then close(period = sPeroid)[1] else Double.NaN;
plot pOpen = if !iOpen then open(period = sPeroid)[1] else Double.NaN;
plot pTodayOpen = if !iTodayOpen then open(period = sPeroid)[0] else Double.NaN;
pHigh.SetDefaultColor (Color.GREEN);
pHigh.SetPaintingStrategy(PaintingStrategy.DASHES);
#thinkscript indicator: Outside_Bar.
#It shows the "Outside Bar" pattern
#by thetrader.top
def bSignalDown=open[1]<close[1]and high>high[1] and close<low[1] or open[1]>close[1] and high>high[1] and close<low[1];
def bSignalUp = open[1]>close[1] and low<low[1] and close>high[1] or open[1]<close[1] and low<low[1] and close>high[1];
plot down = if bSignalDown then high else double.NaN;
plot up = if bSignalUp then high else double.NaN;
up.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_up);
down.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_down);
up.setDefaultColor(color.LIGHT_green);
down.setDefaultColor(color.LIGHT_red);
#thinkscript indicator:Inside_Bar.
#Shows the pattern “Inside Bar”
#by thetrader.top
def bSignalDown = open[1]>close[1] and open<close and high<high[1] and low>low[1];
def bSignalUp = open[1]<close[1] and open>close and high<high[1] and low>low[1];
plot down = if bSignalDown then high else double.NaN;
plot up = if bSignalUp then high else double.NaN;
up.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_up);
down.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_down);
up.setDefaultColor(color.LIGHT_green);
down.setDefaultColor(color.LIGHT_red);
#thinkscript indicator: Double_Outside_bar.
#Shows the pattern "Double Outside bar."
#by thetrader.top
def bSignalDown = 0;
def bSignalUp = high[2]<high[1] and high[1]<high and low[2]>low[1] and low[1]>low;
plot down = if bSignalDown then high else double.NaN;
plot up = if bSignalUp then high else double.NaN;
up.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_up);
down.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_down);
up.setDefaultColor(color.LIGHT_green);
down.setDefaultColor(color.LIGHT_red);
#thinkscript indicator: Double_Inside_bar.
#Shows the pattern "Double Inside bar"
#by thetrader.top
def bSignalDown = high[2]>high[1] and high[1]>high and low[2]<low[1] and low[1]<low;
def bSignalUp = 0;
plot down = if bSignalDown then high else double.NaN;
plot up = if bSignalUp then high else double.NaN;
up.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_up);
down.SetPaintingStrategy(paintingStrategy.BOOLEAN_ARROW_down);
up.setDefaultColor(color.LIGHT_green);
down.setDefaultColor(color.LIGHT_red);
Stan_L offered a treasure trove, but were you able to make money with them?? A treasure chest....but again will it help to make money.Download this almost 200 page PDF for training and examples of thinkscript. This is StanL's original file that the TOS helpdesk often refers to.
https://onedrive.live.com/redir?res...F file|2dd9ed19-44e9-4f45-a8d7-b00efc857ea5/)
It's from JQ's OneNote. Thanks and credit go to him for making this resource available.
Most of his code is for example purposes only and not necessarily designed for actual trade use, but some of the code does work well... I have used his examples as guides in writing my own custom studies...Stan_L offered a treasure trove, but were you able to make money with them?? A treasure chest....but again will it help to make money.
Yes,...you are right, many experimental pieces....Most of his code is for example purposes only and not necessarily designed for actual trade use, but some of the code does work well... I have used his examples as guides in writing my own custom studies...
#Name: ChrisStoplight LABELS ONLY
#Programmed By: Chris Ball (xxx) on #1/31/09
#Added Choppiness and Squeeze Indicator by Mobius@Thinkscript Lounge
#Added FW_Mobo_Basic
#Modified to add/change indicators
#Modified to show labels only @MerryDay 12/2020
input rsilength = 5;
def c = close;
def h = high;
def l = low;
def o = open;
#MOMENTUM
input lengthmo = 5;
def Momentum = c - c[lengthmo];
def mopos = if Momentum >= 0 then 3 else 2;
def moneg = if Momentum < 0 then 3 else 2;
#CCI
input lengthcci = 13;
def pricecci = c + l + h;
def linDev = LinDev(pricecci, lengthcci);
def CCI = if linDev == 0 then 0 else (pricecci - Average(pricecci, lengthcci)) / linDev / 0.015;
def cci1 = if CCI >= 0 then 4 else 3;
def cci2 = if CCI < 0 then 4 else 3;
#RSI
def rsi = reference RSI(length = rsilength)."RSI";
def rsi1 = if rsi >= 50 then 5 else 4;
def rsi2 = if rsi < 50 then 5 else 4;
#Bollinger Bands MOBO
input lengthmobo = 10;
input Num_Dev_Dn = -0.8;
input Num_Dev_up = 0.8;
def sDev = StDev(data = c, length = lengthmobo);
def Midmobo = Average(c, length = lengthmobo);
def Lowermobo = Midmobo + Num_Dev_Dn * sDev;
def Uppermobo = Midmobo + Num_Dev_up * sDev;
def upmobo = if upmobo[1] == 0 and c >= Uppermobo then 1 else if upmobo[1] == 1 and c > Lowermobo then 1 else 0;
def upmo = if upmobo and c > Uppermobo then 1 else 0;
def dnmo = if !upmobo and c > Lowermobo then 1 else 0;
def mobo1 = if upmobo == 1 then 6 else 5;
def mobo2 = if upmobo == 0 then 6 else 5;
#Trend
#Choppiness Indicator from Mobius @My Trade with color changes by Lar
#Set ADX & SMA to how you trade
#Indicates Trending or Chop along with current ADX level
def ADXLength = 5; #TOS default 10
input AverageType = AverageType.HULL;
def AvgLength = 5; #TOS default 8
def Lengthchop = 8;
def Signal = 3;
def Choppy = 61.8;
def MidLine = 50;
def Trending = 38.2;
def ADX = Round(reference ADX(length = ADXLength), 0);
def AVG = MovingAverage(AverageType = AverageType, c, AvgLength);
def CIB = ((Log(Sum(TrueRange(h, c, l), Lengthchop) /
(Highest(if h >= c[1] then h else
c[1], Lengthchop) -
Lowest( if l <= c[1] then l else c[1], Lengthchop)))
/ Log(10)) / (Log(Lengthchop) / Log(10))) * 100;
def CI = CIB;
#Choppiness/Trend Indicator
def chop = if CI > MidLine then 7 else 6;
def trend1 = if CI < MidLine and c > AVG then 7 else 6;
def trend2 = if CI < MidLine and c < AVG then 7 else 6;
#Overall
def uptrend = if mopos == 3 and cci1 == 4 and rsi1 == 5 and mobo1 == 6 then 8 else 7;
def dntrend = if moneg == 3 and cci2 == 4 and rsi2 == 5 and mobo2 == 6 then 8 else 7;
#Squeeze by Mobius @ My Trade with color mod by Lar
#Look at Cloud Color as a possible indication of direction once squeeze ends
def nK = 1.5;
def nBB = 2.0;
def lengthsqueeze = 20;
def BBHalfWidth = StDev(c, lengthsqueeze);
def KCHalfWidth = nK * Average(TrueRange(h, c, l), lengthsqueeze);
def isSqueezed = nBB * BBHalfWidth / KCHalfWidth < 1;
#Squeeze for Longer Term Trend Indicator
def BBS_Ind = if isSqueezed then 8.2 else Double.NaN;
DefineGlobalColor("Pre_Cyan", CreateColor(0, 150, 200)) ;
DefineGlobalColor("LabelGreen", CreateColor(0, 165, 0)) ;
DefineGlobalColor("Label2Green", CreateColor(0, 200, 0)) ;
DefineGlobalColor("LabelRed", CreateColor(225, 0, 0)) ;
AddLabel(yes, "MOMENTUM " + Round(Momentum, 2), if Momentum >= 0 then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes,
if CCI < -100 and CCI > CCI[1] then "CCI down but rising " +round(CCI,0) else
if CCI < -100 then "CCI down & falling " +round(CCI,0) else
if CCI > 100 and CCI > CCI[1] then "CCI TRENDING " +round(CCI,0) else
if CCI > 100 then "CCI Hi but falling " +round(CCI,0) else
if CCI < 0 and CCI > CCI[1] then "CCI low but rising " +round(CCI,0) else
if CCI < 0 then "CCI low & falling " +round(CCI,0) else
if CCI > CCI[1] then "CCI Rising " +round(CCI,0) else "CCI Falling " +round(CCI,0),
if CCI < -100 and CCI > CCI[1] then color.violet else
if CCI < -100 then color.dark_red else
if CCI > 100 and CCI > CCI[1] then GlobalColor("Pre_Cyan") else
if CCI > 100 then color.violet else
if CCI < 0 and CCI > CCI[1] then color.violet else
if CCI < 0 then GlobalColor("LabelRed") else
if CCI > CCI[1] then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes,
if rsi < 20 then "RSI bottom " +round(rsi,0) else
if rsi > 80 then "RSI max " +round(rsi,0) else
if rsi > rsi[1] then "RSI Rising " +round(rsi,0) else "RSI Falling " +round(rsi,0),
if rsi < 20 then Color.Dark_red else
if rsi > 80 then GlobalColor("Label2Green") else
if rsi > rsi[1] then GlobalColor("LabelGreen") else GlobalColor("LabelRed"));
AddLabel(yes, if upmobo and upmo then "Mobo Above Upper" else
if !upmo and dnmo then "Mobo Below Lower" else "Mobo Inside",
if upmobo and upmo then GlobalColor("LabelGreen") else
if !upmo and dnmo then color.violet else GlobalColor("LabelRed"));
AddLabel(yes, if CI < 38.2 then "Trending " +round(CI,0) else
if CI > 61.8 then "CHOPPY " +round(CI,0) else "No Chop " +round(CI,0),
if CI < 38.2 then GlobalColor("Pre_Cyan") else
if CI > 61.8 then GlobalColor("LabelRed") else
if CI > midLine then GlobalColor("Label2Green") else GlobalColor("LabelGreen"));
AddLabel(yes,
if ADX <= 20 then "ADX No Trend " +round(ADX,0) else
if ADX > 40 then "ADX WOW " +round(ADX,0) else "ADX Trending " +round(ADX,0),
if ADX < 20 then GlobalColor("LabelRed") else
if ADX > 40 then GlobalColor("Pre_Cyan") else GlobalColor("LabelGreen"));
AddLabel(yes, if uptrend == 8 then "Trend All Up " else if dntrend == 8 then "Trend All Down " else "Trend Mixed ", if uptrend == 8 then GlobalColor("LabelGreen") else if dntrend == 8 then GlobalColor("LabelRed") else Color.GRAY);
#Count of Periods in consecutive squeeze
rec count = if isSqueezed then count[1] + 1 else 0;
AddLabel(yes, if isSqueezed then Concat("Squeeze ", count) else "No Squeeze", Color.DARK_ORANGE);
Seems like the Thinkscript community OneNote notebook is no longer accessible. Does anyone have a copy of it that you can share?
The link to the thinkScript Community OneNote is: http://b.link/tSCommunity or https://1drv.ms/u/s!AnkeHrrRM_cvgxQTl1xckINYlKhZ
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
thinkScript IDE For ThinkOrSwim | Tutorials | 5 | ||
Thinkorswim Chart Study and Thinkscript Plot Hierarchy | Tutorials | 5 | ||
How to debug ThinkScript | Tutorials | 6 | ||
thinkScript BarNumber() Function Usage and Examples | Tutorials | 7 | ||
D | AddOrder thinkScript - Backtest Buy & Sell in ThinkorSwim | Tutorials | 184 |
Start a new thread and receive assistance from our community.
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.
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.