# The Universe of ThinkScript - Your One Stop Research Shop!

#### ccurtin

##### New member
VIP
In, @martinflds . TYVM...

#### markos

##### Well-known member
VIP
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.
Hi @BenTen , You may want to move that Google Drive to the Tutorials and pin it. Would that work better? Just wondering. Take care!

#### BenTen

Staff
VIP
@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.

#### markos

##### Well-known member
VIP
@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.
Big duh! on my part, thanks

#### lukeskywalker

##### New member
Hi guys. A lot of useful scripts have accumulated. I want to share in this thread.

First script is HIGH, LOW, OPEN, CLOSE – SUPPORT AND RESISTANCE LINE
The indicator will draw levels Opening, Close, High, and Low of a current and previous day on the chart.

Code:
#thinkscript indicator : OCHLO_levels
#It draws yesterday High, Low, Open, Close support and resistance line
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);

"Outside Bar" Indicator

The indicator shows us the "Outside Bar" pattern.
It will be shown on any timeframe but I recommend looking at the daytime period. You will see a certain number of signals on the chart.

Code:
#thinkscript indicator: Outside_Bar.
#It shows the "Outside Bar" pattern

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

The "Inside Bar" candlestick pattern is shown with arrows when the candlestick pattern is formed in the chart. An Inside Bar is formed when price trades within the high and low range of the previous day, making the candle an inside day or an inside bar. The inside bar is therefore a two candlestick price pattern. An inside bar is also similar to a bullish or a bearish harami candlestick pattern.

⚙Install the indicator in Thinkorswim. There are no special settings, but you can set the color of the arrows, size and so on.
_______________________________________
Code:
#thinkscript indicator:Inside_Bar.
#Shows the pattern “Inside Bar”

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

The Double Outside Bar candlestick pattern shows signals on the chart with arrows at the moment when such pattern is formed. The signal is very rare.

⚙ First, import indicator by using <Edit Studies> menu. It will appear on the list, but you cannot see it right away.You need to enter Studies – User Defined. Click on the necessary indicator and add - "Add Study". There are no special settings for this indicator.
_______________
Code:
#thinkscript indicator: Double_Outside_bar.
#Shows the pattern "Double Outside bar."

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

Last edited by a moderator:

#### lukeskywalker

##### New member
Double Inside Bar Indicator

Candlestick pattern indicator Double Inside Bar shows when the "inside bar" pattern is drawn on the chart 2 times in a row. The signal is very rare as in the "Double Outside bar" Indicator.

⚙First, import indicator by using <Edit Studies> menu. It will appear on the list, but you cannot see it right away.
You need to enter Studies – User Defined. Click on the necessary indicator and add - "Add Study". There are no special settings for this indicator.
________________
Code:
#thinkscript indicator: Double_Inside_bar.
#Shows the pattern "Double Inside bar"

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

#### markos

##### Well-known member
VIP
@lukeskywalker thank you for your contributions to useThinkscript. It's very much appreciated!

T

#### Thomas

VIP
Last edited:

##### Well-known member
VIP
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.
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...

T

#### Thomas

##### Active member
VIP
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...
Yes,...you are right, many experimental pieces....