make the gap extends to the right if it is not completely filled

2233jat

New member
this thread is somewhat old, but i wanted to ask if someone can make the gap extends to the right if it is not completely filled..so itll go past the current 1 day setting until the day it is filled, And the %remaining label, if its at 0% can we hide it. Thank you! so far its an awesome script!

hello guys, the current gapfill scrfipt here, can someonme help make this script extend the unfilled gaps to the right of the chart, so i can see it continue as long as its not filled and able to see it up to the daily chart, currently its up to 1hr? currently it stops at market close each day. I'd like to see it continue if it hasn't been filled for example weeks later or days later it'll fill. Thank you in advance!
theresa-wedding-sis.jpg

#- TS_GapFill
#- http://www.thinkscripter.com
#- [email protected]
#- Last Update 28 Jan 2010

input marketOpenTime = 0930;

input marketCloseTime = 1615;

def yesterdaysClose = close(period = "DAY")[1];

def secondsFromOpen = SecondsFromTime(marketOpenTime);

def secondsTillClose = SecondsTillTime(marketCloseTime);

def marketOpen = if secondsFromOpen >= 0 and secondsTillClose >= 0 then 1 else 0;

rec regularHoursOpen = if (secondsFromOpen >= 0 and secondsFromOpen[1] < 0) or

(GetDay() != GetDay()[1]) then open else regularHoursOpen[1];

def newDay = if GetDay() != GetDay()[1] then 1 else 0;

rec regHoursHigh = if newDay then high else if marketOpen then

if high > regHoursHigh[1] then high else regHoursHigh[1] else high;

rec regHoursLow = if newDay then low else if marketOpen then

if low < regHoursLow[1] then low else regHoursLow[1] else low;

def yc = if marketOpen then yesterdaysClose else Double.NaN;

def o = if marketOpen then regularHoursOpen else Double.NaN;

def hg = o + (yc - o) / 2;

def gapUp = if yc < o then 1 else 0;

def gapDown = if yc > o then 1 else 0;

def gapRemaining = if gapUp then

Max(regHoursLow - yc, 0) else

if gapDown then Max(yc - regHoursHigh, 0) else 0;

def percentRemaining = 100 * gapRemaining / AbsValue(yc - o);

def gapFilled = if percentRemaining == 0 then 1 else 0;

def halfGapFilled = if percentRemaining <= 50 then 1 else 0;

plot gH = if (gapUp and !gapFilled and marketOpen and !newDay[-1])

then regHoursLow else if (gapDown and !gapFilled and marketOpen and !newDay[-1])

then yc else Double.NaN;

plot gL = if (gapUp and !gapFilled and marketOpen and !newDay[-1])

then yc else if (gapDown and !gapFilled and marketOpen and !newDay[-1])

then regHoursHigh else Double.NaN;

plot hGF = if !gapFilled and !halfGapFilled and marketOpen and !newDay[-1]

then hg else Double.NaN;

gH.SetPaintingStrategy(PaintingStrategy.DASHES);

gH.AssignValueColor(if gapDown then Color.WHITE else Color.WHITE);

gL.SetPaintingStrategy(PaintingStrategy.DASHES);

gL.AssignValueColor(if gapDown then Color.WHITE else Color.WHITE);

hGF.SetStyle(Curve.LONG_DASH);

hGF.SetDefaultColor(Color.DARK_GRAY);

gH.HideBubble();

gL.HideBubble();

hGF.HideBubble();

AddCloud(gH, gL, Color.VIOLET, Color.VIOLET);

AddLabel(gapUp or gapDown and percentRemaining != 0, Concat(percentRemaining, " % Gap Remaining"), Color.WHITE);

#end

any help on this anybody? waiting patiently lol
 
Last edited by a moderator:
Solution
this thread is somewhat old, but i wanted to ask if someone can make the gap extends to the right if it is not completely filled..so itll go past the current 1 day setting until the day it is filled, And the %remaining label, if its at 0% can we hide it. Thank you! so far its an awesome script!

hello guys, the current gapfill scrfipt here, can someonme help make this script extend the unfilled gaps to the right of the chart, so i can see it continue as long as its not filled and able to see it up to the daily chart, currently its up to 1hr? currently it stops at market close each day. I'd like to see it continue if it hasn't been filled for example weeks later or days later it'll fill. Thank you in advance!

here is a gap...
this thread is somewhat old, but i wanted to ask if someone can make the gap extends to the right if it is not completely filled..so itll go past the current 1 day setting until the day it is filled, And the %remaining label, if its at 0% can we hide it. Thank you! so far its an awesome script!

hello guys, the current gapfill scrfipt here, can someonme help make this script extend the unfilled gaps to the right of the chart, so i can see it continue as long as its not filled and able to see it up to the daily chart, currently its up to 1hr? currently it stops at market close each day. I'd like to see it continue if it hasn't been filled for example weeks later or days later it'll fill. Thank you in advance!

here is a gap study i made awhile ago. it draws a cloud from a gap
as the gap is filled, the cloud gets narrower
https://usethinkscript.com/threads/...-price-crosses-into-it-for-thinkorswim.11186/
 
Solution

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Last edited:
Thread starter Similar threads Forum Replies Date
M ES gap for the next day? 4pm or 4:15pm. Questions 1
B Gap Up % on Watchlist Questions 0
Eyl Gap reduction Questions 1
B Gap% column Questions 0
K HMA Gap Strategy Help Questions 2

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
385 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top