# choose to scan up down gaps
# 1 = Only up gaps
# 2 = Only down gaps
# 3 = BOTH up and down gaps
input GapDirection = 3;
#set min max gap size you would like.
input minimumPercentFromPriorClose = 1.0;
input minimumDollarsFromPriorClose = 1.0;
input MaximumPercentFromPriorClose = 100.0;
input MaximumDollarsFromPriorClose = 100.0;
# makes sure there is a gap between the currentprice and the prior High/low, not just from the prior close
input OutsideYesterdaysRange = no;
#Looks for only gaps that are gapping up over red candle or gapping downsideGapThreeMethods under green candle, in addition the other criteria, Some people believe this adds "shock value" and forces people to cover their positions, adding momentum in the direction of the gap.
input GapAboveRedOrBeLowGreen = no;
# choose to only look for gapsthat havent filled yet interday
input OnlyGapsThatHaventFilled = no;
# if set to yes then scan will only consider a gap to be filled id the current days price action has touch previous days close.
input GapIsOnlyFilledAtClose = yes;
#Only change these if you are dealing with special marketor know what your doing
input MarketOpenTime = 0930;
input MarketCloseTime = 1600;
# Average Price Movements
# Assembled by BenTen at useThinkScript.com
# Converted from https://www.tradingview.com/script/eHhGyI6R-CD-Average-Daily-Range-Zones-highs-and-lows-of-the-day/
input aggregationPeriod = AggregationPeriod.DAY;
def open = open(period = aggregationPeriod);
def high = high(period = aggregationPeriod);
def low = low(period = aggregationPeriod);
def dayrange = (high - low);
def r1 = dayrange[1];
def r2 = dayrange[2];
def r3 = dayrange[3];
def r4 = dayrange[4];
def r5 = dayrange[5];
def r6 = dayrange[6];
def r7 = dayrange[7];
def r8 = dayrange[8];
def r9 = dayrange[9];
def r10 = dayrange[10];
def adr_10 = (r1 + r2 + r3 + r4 + r5 + r6 + r7 + r8 + r9 + r10) / 10;
def adr_5 = (r1 + r2 + r3 + r4 + r5) / 5;
def hl1 = (OPEN + (adr_10 / 2));
def ll1 = (OPEN - (adr_10 / 2));
def hl2 = (OPEN + (adr_5 / 2));
def ll2 = (OPEN - (adr_5 / 2));
plot h1 = hl1;
plot l1 = ll1;
plot h2 = hl2;
plot l2 = ll2;
addCloud(h1, h2, color.RED, color.RED);
addCloud(l1, l2, color.GREEN, color.GREEN);
h1.SetDefaultColor(Color.dark_red);
h2.SetDefaultColor(Color.dark_red);
l1.SetDefaultColor(Color.dark_green);
l2.SetDefaultColor(Color.dark_green);
I"m working on finding one, I will post it if/when I find one. BTW I've switched my aggregation period to 1WK. I believe this is the same stradegy that Truetrader.net usesK.O Trader, much respect to you!! Thanks for sharing the code too! The other component that we are looking for is the SCAN to find surging stocks in the first few minutes of opening of regular trading day toward either of the two "zones". There are too many stocks to search individually in the beginning of the trading day to do this manually. Is it possible to have a SCAN to bring to the forefront these surging stocks in the very start of the trading day???
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
A | Three up days in a row with a gap down (and vice versa) | Questions | 1 | |
S | Identify Gap-Up Pattern | Questions | 8 | |
M | ES gap for the next day? 4pm or 4:15pm. | Questions | 1 | |
B | Gap Up % on Watchlist | Questions | 0 | |
Gap reduction | Questions | 1 |
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.