Close Prices in Ascending Order

Vamsy

New member
Can Close Prices of last 5 Days Sorted in Ascending Order in TOS...?

Example
: Close Prices of X in Last 5 Days are 20,15,18,22,10.

Can these Values Sorted in Ascending Order and Added to Labels...?

Result Expected in TOS Labels : 10,15,18,20,22
 
Solution
Mentioned threads have sorted/ assigned ranking in Descending order.

Can the Close Values Sorted in Ascending Order…?

? they are in ascending order.
1 is assigned to the lowest number and 10 to the highest of 10 numbers. and those in between are numbered accordingly.


i am away now , so i'm typing this on my cell. in a few days i can verify this.

copy the code from here
post4
https://usethinkscript.com/threads/rank-volume-1-10.9504/#post-100206

paste it in as a new study
set chart to day

change this to 5
input qty = 10;


add this to the end

Code:
def dat1 = if bn >= rngbar1 and rank3 == 1 then data else dat1[1];
def dat2 = if bn >= rngbar1 and rank3 == 2 then data else dat2[1];
def dat3 = if bn >= rngbar1 and rank3...
Can Close Prices of last 5 Days Sorted in Ascending Order in TOS...?

Example
: Close Prices of X in Last 5 Days are 20,15,18,22,10.

Can these Values Sorted in Ascending Order and Added to Labels...?

Result Expected in TOS Labels : 10,15,18,20,22

it is possible to assign a ranking number to some values in a variable.
then you could look for each rank number , find an offset, and read the desired data.

this post mentions 3 links
https://usethinkscript.com/threads/...a-bubble-eg-addchartbubble.11525/#post-100022
 

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

Mentioned threads have sorted/ assigned ranking in Descending order.

Can the Close Values Sorted in Ascending Order…?

? they are in ascending order.
1 is assigned to the lowest number and 10 to the highest of 10 numbers. and those in between are numbered accordingly.


i am away now , so i'm typing this on my cell. in a few days i can verify this.

copy the code from here
post4
https://usethinkscript.com/threads/rank-volume-1-10.9504/#post-100206

paste it in as a new study
set chart to day

change this to 5
input qty = 10;


add this to the end

Code:
def dat1 = if bn >= rngbar1 and rank3 == 1 then data else dat1[1];
def dat2 = if bn >= rngbar1 and rank3 == 2 then data else dat2[1];
def dat3 = if bn >= rngbar1 and rank3 == 3 then data else dat3[1];
def dat4 = if bn >= rngbar1 and rank3 == 4 then data else dat4[1];
def dat5 = if bn >= rngbar1 and rank3 == 5 then data else dat5[1];

addlabel(1, dat1, color.yellow);
addlabel(1, dat2, color.yellow);
addlabel(1, dat3, color.yellow);
addlabel(1, dat4, color.yellow);
addlabel(1, dat5, color.yellow);
 
Solution
? they are in ascending order.
1 is assigned to the lowest number and 10 to the highest of 10 numbers. and those in between are numbered accordingly.


i am away now , so i'm typing this on my cell. in a few days i can verify this.

copy the code from here
post4
https://usethinkscript.com/threads/rank-volume-1-10.9504/#post-100206

paste it in as a new study
set chart to day

change this to 5
input qty = 10;


add this to the end

Code:
def dat1 = if bn >= rngbar1 and rank3 == 1 then data else dat1[1];
def dat2 = if bn >= rngbar1 and rank3 == 2 then data else dat2[1];
def dat3 = if bn >= rngbar1 and rank3 == 3 then data else dat3[1];
def dat4 = if bn >= rngbar1 and rank3 == 4 then data else dat4[1];
def dat5 = if bn >= rngbar1 and rank3 == 5 then data else dat5[1];

addlabel(1, dat1, color.yellow);
addlabel(1, dat2, color.yellow);
addlabel(1, dat3, color.yellow);
addlabel(1, dat4, color.yellow);
addlabel(1, dat5, color.yellow);
How to do it for Every 5 Day Rolling...?

Ranking Logic is taking the Quantity as a Base Reference and Computing the Ranking Values of Given Quantity.

Do You have any reference Script For Rolling Range of Quantity....??
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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