Low Study Indicator Signal? Study is crunched up??

JP782

Active member
How do you input the script where a lower study indicator will signal a cross with an arrow, point, square etc but not crunch the study down??

Right not I just have it giving a signal when all the timeframes are crossed up

How do I write it so the study isnt crunched up, line of dots at bottom etc (obviously have same problem with the other study)??

q574JvQ.png


def condAllUp = if condCross and condCross2 and condCross3 and condCross4 and condCross5 and condCross10 then 1 else 0;
plot UP = condAllUp and !condAllUp[1];
Up.setpaintingstrategy(paintingstrategy.POINTS);
Up.setdefaultcolor(color.green);
Up.setlineweight(2);
 
Last edited by a moderator:
Solution
@JP782 you are telling it to plot at 1 by assigning the value of 1 to condAllUp.
Change your plot line to:
Ruby:
plot UP = if condAllUp and !condAllUp[1] then 0 else double.nan;
Change '0' the in the code above to where you want the plot to be (high, low, close, EMA, MA, etc.).
@JP782 you are telling it to plot at 1 by assigning the value of 1 to condAllUp.
Change your plot line to:
Ruby:
plot UP = if condAllUp and !condAllUp[1] then 0 else double.nan;
Change '0' the in the code above to where you want the plot to be (high, low, close, EMA, MA, etc.).
 
Solution
@JP782 you are telling it to plot at 1 by assigning the value of 1 to condAllUp.
Change your plot line to:
Ruby:
plot UP = if condAllUp and !condAllUp[1] then 0 else double.nan;
Change '0' the in the code above to where you want the plot to be (high, low, close, EMA, MA, etc.)
Ok so you cant necessarily have it paint where the instance occurs on a lower study
 
Ok so you cant necessarily have it paint where the instance occurs on a lower study

sure you can, you have that in post 1.
it is plotting shapes at true and false, 1 and 0 , and that is what you have. it is plotting something when the plot formula is true and false.

generally , studies are setup to only plot something when a condition is true. that is what svanoy posted. when true, plot something at 0, else don't plot anything.

in a lower chart, plots are scaled to fit. you have plot values at 0 and 1, so that is what you see.
try adding a line , to see if the result helps you understand what is happening.
plot z1 = 3;
add another line
plot z2 = -2;

maybe you intended to plot boolean shapes on the lower chart?
you can try it, but they don't work. they will end up plotting at levels equal to the upper charts stock close price.

why is this a lower study?
why aren't you plotting signal arrows on the main chart?
 
Last edited by a moderator:
sure you can, you have that in post 1.
it is plotting shapes at true and false, 1 and 0 , and that is what you have. it is plotting something when the plot formula is true and false.

generally , studies are setup to only plot something when a condition is true. that is what svanoy posted. when true, plot something at 0, else don't plot anything.

in a lower chart, plots are scaled to fit. you have plot values at 0 and 1, so that is what you see.
try adding a line , to see if the result helps you understand what is happening.
plot z1 = 3;
add another line
plot z2 = -2;

maybe you intended to plot boolean shapes on the lower chart?
you can try it, but they don't work. they will end up plotting at levels equal to the upper charts stock close price.

why is this a lower study?
why aren't you plotting signal arrows on the main chart?
Well theres more to it, this is just a piece, Im doing it on the lower to work out the bugs for an upper study bc I need to see where crosses take place for MTF MACD2lines
 

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
354 Online
Create Post

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