Fair Value Gap zones make it appear after one get broken

christianmarmol

New member
I would appreciate the help with this program Im trying to make the FVG zone appear and disappear if they get broken, I so far got them to disappear but can find the way to make appear again. I think i need to find a way to hold a variable for reuse but don't know how on thinkscript


input tamanoDelGap=3;
def bearFVGUp = high < low[2];
def bullFVGDown = low > high[2];


# Calculate the gap boundaries

def FVGUpTop = if (bearFVGUp and low[2]-high >tamanoDelGap)then low[2] else if( close < fvguptop[1])then fvguptop[1] else double.NaN;
def FVGUpBottom = if (bearFVGUp and low[2]-high >tamanoDelGap) then high else if( close < fvguptop[1])then FVGUpBottom[1] else double.NaN;

def FVGDownTop = if (bullFVGDown and high[2] - low <tamanoDelGap) then high[2] else if (close > fvgDownTop[1])then fvgDownTop[1] else double.NaN ;
def FVGDownBottom = if(bullFVGDown and high[2] - low <tamanoDelGap) then low else if (close > fvgDownTop[1])then FVGDownBottom[1] else double.NaN;
input cloudSize= 0;

DefineGlobalColor("CloudS", Color.gray);
DefineGlobalColor("CloudR", Color.gray);
#Global Color For Levels(Support)
DefineGlobalColor("UpLevels", Color.black);
#Global Color For Levels(Resistance)
DefineGlobalColor("DnLevels", Color.black);


plot cloud1Bear_top = FVGUpTop;
cloud1Bear_top.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1bear_top.setdefaultColor(color.red);
cloud1Bear_top.SetLineWeight(2);
plot cloud1Bear_bot = FVGUpBottom;
cloud1Bear_bot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1Bear_bot.setdefaultColor(color.red);
cloud1Bear_bot.SetLineWeight(2);

AddCloud(cloud1Bear_top, cloud1Bear_bot, GlobalColor("CloudS"), GlobalColor("CloudS"), yes);

plot cloud1Bull_top = FVGDownTop ;
cloud1Bull_top.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1Bull_top.setdefaultColor(color.green);
cloud1Bull_top.SetLineWeight(2);

plot cloud1Bull_bot = FVGDownBottom ;
cloud1Bull_bot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1Bull_bot.setdefaultColor(color.green);
cloud1Bull_bot.SetLineWeight(2);
AddCloud(cloud1Bull_top, cloud1Bull_bot, GlobalColor("CloudS"), GlobalColor("CloudS"), yes);
 
Solution
I would appreciate the help with this program Im trying to make the FVG zone appear and disappear if they get broken, I so far got them to disappear but can find the way to make appear again. I think i need to find a way to hold a variable for reuse but don't know how on thinkscript


input tamanoDelGap=3;
def bearFVGUp = high < low[2];
def bullFVGDown = low > high[2];


# Calculate the gap boundaries

def FVGUpTop = if (bearFVGUp and low[2]-high >tamanoDelGap)then low[2] else if( close < fvguptop[1])then fvguptop[1] else double.NaN;
def FVGUpBottom = if (bearFVGUp and low[2]-high >tamanoDelGap) then high else if( close < fvguptop[1])then FVGUpBottom[1] else double.NaN;

def FVGDownTop = if (bullFVGDown and high[2] - low...
I would appreciate the help with this program Im trying to make the FVG zone appear and disappear if they get broken, I so far got them to disappear but can find the way to make appear again. I think i need to find a way to hold a variable for reuse but don't know how on thinkscript


input tamanoDelGap=3;
def bearFVGUp = high < low[2];
def bullFVGDown = low > high[2];


# Calculate the gap boundaries

def FVGUpTop = if (bearFVGUp and low[2]-high >tamanoDelGap)then low[2] else if( close < fvguptop[1])then fvguptop[1] else double.NaN;
def FVGUpBottom = if (bearFVGUp and low[2]-high >tamanoDelGap) then high else if( close < fvguptop[1])then FVGUpBottom[1] else double.NaN;

def FVGDownTop = if (bullFVGDown and high[2] - low <tamanoDelGap) then high[2] else if (close > fvgDownTop[1])then fvgDownTop[1] else double.NaN ;
def FVGDownBottom = if(bullFVGDown and high[2] - low <tamanoDelGap) then low else if (close > fvgDownTop[1])then FVGDownBottom[1] else double.NaN;
input cloudSize= 0;

DefineGlobalColor("CloudS", Color.gray);
DefineGlobalColor("CloudR", Color.gray);
#Global Color For Levels(Support)
DefineGlobalColor("UpLevels", Color.black);
#Global Color For Levels(Resistance)
DefineGlobalColor("DnLevels", Color.black);


plot cloud1Bear_top = FVGUpTop;
cloud1Bear_top.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1bear_top.setdefaultColor(color.red);
cloud1Bear_top.SetLineWeight(2);
plot cloud1Bear_bot = FVGUpBottom;
cloud1Bear_bot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1Bear_bot.setdefaultColor(color.red);
cloud1Bear_bot.SetLineWeight(2);

AddCloud(cloud1Bear_top, cloud1Bear_bot, GlobalColor("CloudS"), GlobalColor("CloudS"), yes);

plot cloud1Bull_top = FVGDownTop ;
cloud1Bull_top.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1Bull_top.setdefaultColor(color.green);
cloud1Bull_top.SetLineWeight(2);

plot cloud1Bull_bot = FVGDownBottom ;
cloud1Bull_bot.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
cloud1Bull_bot.setdefaultColor(color.green);
cloud1Bull_bot.SetLineWeight(2);
AddCloud(cloud1Bull_top, cloud1Bull_bot, GlobalColor("CloudS"), GlobalColor("CloudS"), yes);

look at this and see if it is close to what you want.
it shows a cloud for a gap. the cloud gets shorter as price crosses the gap.
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.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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