25% and 75% added to this script

draw9300

Member
CbZp5Vf.gif

def value = (high + low) / 2;
def value_fix = if isnan(value) then value_fix[1] else value;

plot Fib50 = if isnan(close[-1]) then value_fix else double.nan;
Fib50.SetPaintingStrategy(PaintingStrategy.DASHES);
Fib50.SetDefaultColor(color.white);


As a candle expands the 75% and 25% lines could add more value along with the 50%. I don't know how to do add them
 
Solution
CbZp5Vf.gif

def value = (high + low) / 2;
def value_fix = if isnan(value) then value_fix[1] else value;

plot Fib50 = if isnan(close[-1]) then value_fix else double.nan;
Fib50.SetPaintingStrategy(PaintingStrategy.DASHES);
Fib50.SetDefaultColor(color.white);


As a candle expands the 75% and 25% lines could add more value along with the 50%. I don't know how to do add them

here is a code that draws 3 lines. can pick the % of the bar height to determine location.
if i am going to have multiple copies of the same code, i add a number to the variable name. per1, per2, per3.....
i could have used a script, but these are short enough that it wouldn't have gained much.

Ruby:
#
input per1 = 25;
#def x1 = (high + low) / 2;
def x1 =...
CbZp5Vf.gif

def value = (high + low) / 2;
def value_fix = if isnan(value) then value_fix[1] else value;

plot Fib50 = if isnan(close[-1]) then value_fix else double.nan;
Fib50.SetPaintingStrategy(PaintingStrategy.DASHES);
Fib50.SetDefaultColor(color.white);


As a candle expands the 75% and 25% lines could add more value along with the 50%. I don't know how to do add them

here is a code that draws 3 lines. can pick the % of the bar height to determine location.
if i am going to have multiple copies of the same code, i add a number to the variable name. per1, per2, per3.....
i could have used a script, but these are short enough that it wouldn't have gained much.

Ruby:
#
input per1 = 25;
#def x1 = (high + low) / 2;
def x1 = ((high - low) * (per1/100)) + low;
def x1_fix = if isnan(x1) then x1_fix[1] else x1;
plot line1 = if isnan(close[-1]) then x1_fix else double.nan;
#line1.SetPaintingStrategy(PaintingStrategy.DASHES);
line1.SetStyle(Curve.short_DASH);
line1.SetDefaultColor(color.white);


input per2 = 50;
def x2 = ((high - low) * (per2/100)) + low;
def x2_fix = if isnan(x2) then x2_fix[1] else x2;
plot line2 = if isnan(close[-1]) then x2_fix else double.nan;
line2.SetPaintingStrategy(PaintingStrategy.DASHES);
line2.SetDefaultColor(color.white);


input per3 = 75;
def x3 = ((high - low) * (per3/100)) + low;
def x3_fix = if isnan(x1) then x3_fix[1] else x3;
plot line3 = if isnan(close[-1]) then x3_fix else double.nan;
#line3.SetPaintingStrategy(PaintingStrategy.DASHES);
line3.SetStyle(Curve.short_DASH);
line3.SetDefaultColor(color.white);

#
 
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
353 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