- ago
I would like to ask if I can rank the stocks already screened by the strategy and set the top N stocks to place the order.

Because I found that the block Symbol Ranking by Indicator is ranking the original stocks in the Backtest DataSet.
It is parallel to the other condition blocks. But I want to filtering with other blocks first and ranking the results.

The Transaction Weight block and the Position Sizing function don't seem to be able to do this either.

Please advise me, and thanks in advance.
0
203
9 Replies

Reply

Bookmark

Sort
- ago
#1
"Set the top N stocks to place the order": based on what criteria?
0
- ago
#2
Hi Eugene,

The criterias and functions of the ranking are the same as in "Symbol Ranking by Indicator".

For example, top10 for RSI3, or top10 for adx7.

Except that instead of the original stock pool, it is applied to the results of other block filters.

I'm worried that my English expression may not be accurate, I don't know if this is clear:

Now:S&P 500 - ranking - 10 results - other blocks - N(0-10)results
hope to be done:S&P 500 - other blocks - N(0-500)results - ranking - 10 results

Is this only possible through program code?
0
- ago
#3
QUOTE:
Except that instead of the original stock pool, it is applied to the results of other block filters.

Your terminology is probably not clear to me. What are "the results of other block filters"? In my book, these are Signals (orders) generated by Strategy.

So your strategy employs the "Symbol Ranking by Indicator" block as one of its rules, and you want to apply such condition in a different way but to Signals now? The Transaction Weight block is the way to prioritize signals.
0
- ago
#4
I think he's trying to implement some kind of pre-filtering prior to ranking them. For some unknown reason, he doesn't want the ranking process to perform any filtering at the same time.

Perhaps he could elaborate on what difference the order of the filtering would have on the final outcome. I would think the filtering order wouldn't matter.

I'm just guessing, but maybe the ranking process is returning too many candidates for trading. But if that were the case, he could simply pick only the top ranking candidates for trading.
1
- ago
#5
Hi Eugene, Sorry that I didn't expressing exactly what I meant, I'll try with an example:

1. database:S&P 500
2. Block1:Close < $20
3. Symbol Ranking by Indicator:Top 10 high price stock

What I got:
("Top 10 high price stock" and "close < $20") of (S&P 500) = 0 results
Because the top 10 most expensive stocks in the S&P 500 are in the hundreds. They can't be less than $20.

What I hope:
("Top 10 high price stock")of ("S&P 500" and "close < $20") = 10 results
The 10 stocks from S&P500 with closing prices starting at $20 from high to low.

But I retried transaction weight as you said today.
I think if I set Max Open Pos, Transaction Weight, and uncheck the "Retain NSF Positions" that's what I want.

I'm running tests and check the results.
0
- ago
#6
Hi John,
Thanks for the clarification. How do you define "Top 10 high price stock", do you take "High" (or other core time series like Close for that matter) for the 'indicator value' parameter? If so, the resultng C# code won't run and throw a runtime error. The Blocks would swallow it, leaving you with 0 results, however.
0
- ago
#7
Hi Eugene

In the example I am referring to the CLOSE price.
But this is just an easy example to illustrate the difference between what I got and what I want.

what I actually use for ranking is more like indicators like rsi & adx and others.

For another example:

S&P 500
Condition Block:close < 20
Ranking:RSI top 10 high

If I use “Symbol Ranking by Indicator”,I got
(RSI top 10 high stocks of S&P 500)and(close < 20)
which could be zero results,because maybe the top 10 highest rsi stocks at the moment are all priced above $20

what I want:
("Top 10 high RSI) of(close < $20 stock of S&P 500) = 10 results
This will absolute have 10 results, as long as there are more than 10 stocks below $20.

I think “transaction weight” works for this logic.
0
- ago
#8
QUOTE:
If I use “Symbol Ranking by Indicator”,I got
(RSI top 10 high stocks of S&P 500)and(close < 20)
which could be zero results,because maybe the top 10 highest rsi stocks at the moment are all priced above $20

No, you get zero results because "Symbol Ranking by Indicator" isn't supporting core time series at the moment (Post #6).

Workaround: instead of Close, take SMA(Close) with period of ONE (to effectively disable smoothing).
0
- ago
#9
Just confirmed Dion's fix for this bug for B82.
0

Reply

Bookmark

Sort