Adding A Cloud To Unfilled Gaps Study

Status
Not open for further replies.

word127

New member
Hello- So after much trial and error I have come up with a study that finds unfilled gaps on the daily timeframe. It works exactly how I want it to. However the next step I was trying to do but can't is create a cloud that extends to the right until the gap gets filled. If you see in the picture, the 2 violet lines are defining the gap ups and the green lines are the gap downs. What I would like it to do is create a cloud that extends to the right which is represented by the yellow lines and grey box (which I drew by hand). I want the cloud to continue to the right every day until the gap is completely filled at which point it would end as shown in the picture. I would like this for all gaps but I just drew the one as an example. Is this possible? I saw in one gap study here that there was a similar effect as shown in the second picture, but this does not work on the daily timeframe and the cloud does not extend continuously until filled. But the visual effect of the example is what I am looking for. I included the picture for reference. Any help would be greatly appreciated. Thanks in advance.

My study:
eOO8p8u.png



Visual example of what I am trying to do:
AWzIv3q.png


My code:
Code:
#Daily Gap Plot

input aggregationPeriod = AggregationPeriod.DAY;

def prevClose = close(period = aggregationPeriod)[1];
def curHigh = high(period = aggregationPeriod);
def curLow = low(period = aggregationPeriod);


def gapDown = if prevClose > curHigh then 1 else 0;
def gapUp = if prevClose < curLow then 1 else 0;


plot gU = if gapUp then curLow else if gapDown then prevClose else double.nan;
plot gD = if gapUp then prevClose else if gapDown then curHigh else double.nan;

gU.SetPaintingStrategy(PaintingStrategy.DASHES);
gU.AssignValueColor(if gapDown then Color.light_green else Color.violet);
gD.SetPaintingStrategy(PaintingStrategy.DASHES);
gD.AssignValueColor(if gapDown then Color.light_green else Color.violet);
gU.HideBubble();
gD.HideBubble();
 
Solution
What I would like it to do is create a cloud that extends to the right which is represented by the yellow lines and grey box (which I drew by hand). I want the cloud to continue to the right every day until the gap is completely filled at which point it would end as shown in the picture.

here is a link to a study that finds gaps.
it doesn't use 2nd aggregation. so set your chart to day.
https://usethinkscript.com/threads/...-reduce-gap-when-price-crosses-into-it.11186/
What I would like it to do is create a cloud that extends to the right which is represented by the yellow lines and grey box (which I drew by hand). I want the cloud to continue to the right every day until the gap is completely filled at which point it would end as shown in the picture.

here is a link to a study that finds gaps.
it doesn't use 2nd aggregation. so set your chart to day.
https://usethinkscript.com/threads/...-reduce-gap-when-price-crosses-into-it.11186/
 
Solution
Status
Not open for further replies.

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
480 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