New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.
Does RANK BY only work with some indications?
Best Answers
-
I didn't know about the ASCENDING feature. It will come in handy for me.
https://support.stockcharts.com/doku.php?id=scans:advanced_scan_syntax#rank_by_clauses
"Rank By Clauses
You can optionally add a line to the very end of your scan that controls the order in which your scan results are displayed. That line must start with “RANK BY,” followed by the expression that you want your results sorted by. For example:
RANK BY [close]
This example would sort the scan results in descending order of current closing price.
There are a few rules for Rank By clauses:
There can only be one Rank By line per scan.
The clause must be the last line of the scan.
You can add “ascending” to the end of the clause to reverse the order of the scan results (e.g. “RANK BY [MACD Hist(12,26,9)] ASCENDING”).
Note: The value of the Rank By expression is also added to the right side of the scan results table. This allows you to examine the value of any expression in your scan directly by making that expression the Rank By expression as well."0 -
These scans seem to work properly:
RANK BY [PctChange(1,close)] DESCENDING
RANK BY [MACD HIST(12,26,9)] ascending
RANK BY [SCTR] descending
These scans do not seem to return the results ranked by these indications:
RANK BY [PMO(35,20,10)] DESCENDING
RANK BY [PPO(12,26,9)] DESCENDING
Everything else in the scan remains the same, these are the only changes that I make to the code.0 -
You can probably eliminate the "Descending". All Rank By is in Descending order.
When you run these, the Rank By information is added as it's own column in the results table.
The PPO and PMO have extra information required.
If you hit the Dropdown in the Technical Attributes, you'll find that there is no PPO or PMO. There is a PPO Line, PPO Signal, PPO Hist. There is a PMO Line, and a PMO Signal.
0 -
I didn’t think about the Line or Signal portion of the indication. I usually don’t let something like that slip by. I include Descending because occasionally I'll do an Ascending sort and I want to differentiate the two. Thanks for your help.0
Answers
-
Can you post your Rank By code that works, and post what doesn't? Sometimes something that doesn't work is a syntax issue.
Bad thing about the Rank By is that is often won't throw an error message in the Check Syntax function.
0
Categories
- All Categories
- 2.3K StockCharts
- 395 SharpCharts
- 146 Other Charting Tools
- 69 Saved Charts and ChartLists
- 1.5K Scanning
- 73 Data Issues
- 177 Other StockCharts Questions
- 218 Technical Analysis
- 155 Using Technical Analysis
- 2 InterMarket and International
- 19 Market and Breadth Indicators
- 42 Market Analysis
- 109 Trading
- 109 Trading Strategies
- 163 S.C.A.N the StockCharts Answer Network forum
- 65 Using this StockCharts Answer Network forum
- 98 s.c.a.n. archives
- 5 Off-Topic
- 6 The Cogitation & Rumination Emporium
- Forum Test Area