Climb the Ladder? :-)

homeplate

Member
I was also trying to write a script which would show the price moving higher. I was using the wizard as a model.

Here is what I came up with so far. I have to go to bed as my Mom is getting ****ed. If you can take a look at this and give me an idea as to where I'm going wrong that would be wonderful. Thank you again J007RMC and always thank you very, very much BenTen and mobius and spider, and everyone! For helping.

PS. I was going to call it Climb The Ladder but thought I would ask for suggestions as you all are better at this then I am right now.

Thank you


Code:
Code:
#Wizard input: price
#Wizard text: is at least
#Wizard input: percent
#Wizard text: %
#Wizard input: Choice
#Wizard text: than
#Wizard input: length
#Wizard text: bars ago


input price = close;
input percent = .015;
input Choice = {default greater, less};
input length = 1;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent1 = .025;
input Choice1 = {default greater, less};
input length1 = 3;

def x = 100*(price==price1 / price1[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent = .50;
input Choice3 = {default greater, less};
input length = 5;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent = 1.25;
input Choice4 = {default greater, less};
input length = 7;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent = 3.00;
input Choice5 = {default greater, less};
input length = 11;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}
input price = close;
input percent = 7.00;
input Choice6 = {default greater, less};
input length = 14;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent = 10.00;
input Choice7 = {default greater, less};
input length = 16;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent = 12.00;
input Choice8 = {default greater, less};
input length = 18;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}


input price = close;
input percent = 15.00;
input Choice9 = {default greater, less};
input length = 21;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}

input price = close;
input percent = 18.00;
input Choice10 = {default greater, less};
input length = 22;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}


input price = close;
input percent =20.00;
input Choice11 = {default greater, less};
input length = 25;

def x = 100*(price / price[length]-1);
plot scan;

switch (Choice){
case greater:
    scan = x >= percent;
case less:
    scan = x <= -percent;
}
 
edit your post and describe what you are trying to do. it looks like you are calculating a % , from the difference of the current bar and some bar in the past (length). then comparing that % to a constant. i'm not sure what you want to see plotted on the chart.

you are plotting a true/false formula, so the output would be lines at 0 or 1 ( if there were no errors).
scan = x >= percent;

you can't reuse the same variable name, price, x , length,... they have to be different.
 
i fixed your code so there isn't any errors, so you can see what it is doing. i hope this helps you get it to where you want it.
you had many variables with the same name. i changed them so all the variables have a unique name.

i am not sure what you want to see on the chart. maybe if you describe what you want to see, someone can help.

i didn't see anything plot.
the formulas are trying to plot a boolean expression, 0 or 1.
scan2 = x2 >= percent2;

Python:
# climbladder_00

#https://usethinkscript.com/threads/climb-the-ladder.6503/
#I was also trying to write a script which would show the price moving higher.
# I was using the wizard as a model.


#Wizard input: price
#Wizard text: is at least
#Wizard input: percent
#Wizard text: %
#Wizard input: Choice
#Wizard text: than
#Wizard input: length
#Wizard text: bars ago


input price0 = close;
input percent0 = .015;
input Choice0 = {default greater, less};
input length0 = 1;

def x0 = 100 * (price0 / price0[length0] - 1);
plot scan0;

switch (Choice0){
case greater:
    scan0 = x0 >= percent0;
case less:
    scan0 = x0 <= -percent0;
}

input price1 = close;
input percent1 = .025;
input Choice1 = {default greater, less};
input length1 = 3;

def x1 = 100 * (price1 == price1 / price1[length1] - 1);
plot scan1;

switch (Choice1){
case greater:
    scan1 = x1 >= percent1;
case less:
    scan1 = x1 <= -percent1;
}

input price2 = close;
input percent2 = .50;
input Choice2 = {default greater, less};
input length2 = 5;

def x2 = 100 * (price2 / price2[length2] - 1);
plot scan2;

switch (Choice2){
case greater:
    scan2 = x2 >= percent2;
case less:
    scan2 = x2 <= -percent2;
}


input price3 = close;
input percent3 = 1.25;
input Choice3 = {default greater, less};
input length3 = 7;

def x3 = 100 * (price3 / price3[length3] - 1);
plot scan3;

switch (Choice3){
case greater:
    scan3 = x3 >= percent3;
case less:
    scan3 = x3 <= -percent3;
}


input price4 = close;
input percent4 = 3.00;
input Choice4 = {default greater, less};
input length4 = 11;

def x4 = 100 * (price4 / price4[length4] - 1);
plot scan4;

switch (Choice4){
case greater:
    scan4 = x4 >= percent4;
case less:
    scan4 = x4 <= -percent4;
}



input price5 = close;
input percent5 = 7.00;
input Choice5 = {default greater, less};
input length5 = 14;

def x5 = 100 * (price5 / price5[length5] - 1);
plot scan5;

switch (Choice5){
case greater:
    scan5 = x5 >= percent5;
case less:
    scan5 = x5 <= -percent5;
}


input price6 = close;
input percent6 = 10.00;
input Choice6 = {default greater, less};
input length6 = 16;

def x6 = 100 * (price6 / price6[length6] - 1);
plot scan6;

switch (Choice6){
case greater:
    scan6 = x6 >= percent6;
case less:
    scan6 = x6 <= -percent6;
}


input price7 = close;
input percent7 = 12.00;
input Choice7 = {default greater, less};
input length7 = 18;

def x7 = 100 * (price7 / price7[length7] - 1);
plot scan7;

switch (Choice7){
case greater:
    scan7 = x7 >= percent7;
case less:
    scan7 = x7 <= -percent7;
}


input price8 = close;
input percent8 = 15.00;
input Choice8 = {default greater, less};
input length8 = 21;

def x8 = 100 * (price8 / price8[length8] - 1);
plot scan8;

switch (Choice8){
case greater:
    scan8 = x8 >= percent8;
case less:
    scan8 = x8 <= -percent8;
}


input price9 = close;
input percent9 = 18.00;
input Choice9 = {default greater, less};
input length9 = 22;

def x9 = 100 * (price9 / price9[length9] - 1);
plot scan9;

switch (Choice9){
case greater:
    scan9 = x9 >= percent9;
case less:
    scan9 = x9 <= -percent9;
}


input price10 = close;
input percent10 = 20.00;
input Choice10 = {default greater, less};
input length10 = 25;

def x10 = 100 * (price10 / price10[length10] - 1);
plot scan10;

switch (Choice10){
case greater:
    scan10 = x10 >= percent10;
case less:
    scan10 = x10 <= -percent10;
}
 
Last edited:
i took one code section and got it to plot something. is this close to what you are trying to do?
the numbers are tiny, so i changed it to be a lower study. plotting values < 1 on a price chart will look like a horizontal line near 0.
Python:
# climbladder_00c

#https://usethinkscript.com/threads/climb-the-ladder.6503/
#I was also trying to write a script which would show the price moving higher.
# I was using the wizard as a model.

declare lower;

input price0 = close;
input percent0 = .015;
input Choice0 = {default greater, less};
input length0 = 2;

def x0 = 100 * (price0 / price0[length0] - 1);

#plot scan0;
#switch (Choice0){
#case greater:
#    scan0 = x0 >= percent0;
#case less:
#    scan0 = x0 <= -percent0;
#}

def scan0 = if x0 >= percent0 then percent0 else if x0 <= -percent0 then -percent0 else scan0[1];
#def scan0 = if x0 >= percent0 then x0 else if x0 <= -percent0 then -x0 else scan0[1];
plot t = scan0;

# ----------------------
plot z = 0;
addchartbubble(yes, 0 , "x0 " + x0 + "\nsc " + scan0 , color.cyan, no);
#
 

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

Thread starter Similar threads Forum Replies Date
DebraMiller rainbow ladder Questions 2
S Having a Crosshair on chart sync with mouse position on active trader's ladder Questions 6

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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