# Delete (#) the plot not needed
plot Bulltrigger = trend and MacdLow and trigATR and PriceSma;
# plot BearTrigger = TrendBear and MacdHighBear and BtrigATR and BPriceSma ;
# Price Action Wedge Patterns
# Include Four and Five Bar Wedges
# Developed based on idea from BenTen of useThinkScript.com
# Study to indicate when a wedge may be forming.
# Author: Kory Gill, @korygill
# Version 1.0
declare upper;
declare once_per_bar;
input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def close = close(period = aggregationPeriod);
def vHigh = high;
def vLow = low;
def nan = Double.NaN;
def range = vHigh - vLow;
def isInsideBar = if range < range[1] and vHigh < vHigh[1] and vLow > vLow[1]
then 1
else 0;
# Define 4 Bars Wedge
def FourBarsWedges = high < high[3] and high[0] < high[3] and high[1] < high[3] and high[2] < high[3] and
low > low[3] and low[0] > low[3] and low[1] > low[3] and low[2] > low[3];
plot up4 = FourBarsWedges;
plot down4 = FourBarsWedges;
up4.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
up4.SetLineWeight(1);
up4.AssignValueColor(Color.Yellow);
down4.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
down4.SetLineWeight(1);
down4.AssignValueColor(Color.Yellow);
# Define 5 Bars Wedge
def FiveBarsWedges = high < high[4] and high[1] < high[4] and high[2] < high[4] and high[3] < high[4] and
low > low[4] and low[1] > low[4] and low[2] > low[4] and low[3] > low[4];
plot up5 = FiveBarsWedges;
plot down5 = FiveBarsWedges;
up5.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
up5.SetLineWeight(1);
up5.AssignValueColor(Color.WHITE);
down5.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
down5.SetLineWeight(1);
down5.AssignValueColor(Color.WHITE);
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
C | Bull Bear Power VOID Oscillator For ThinkOrSwim | Indicators | 21 | |
M | Automatic patterns studies, Bull, Bear, Bullish only & Bearish only For ThinkOrSwim | Indicators | 8 | |
P | High Tight Flag Scanner (Leif Soreide) For ThinkOrSwim | Indicators | 17 |
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.