Your interactive trading laboratory!
 • 
5 users online

Ranking-Rulset by multiples of $10 and Price-Buckets

Months ago, I read about the TASC article "Swing Trading 10-Point Breakouts". First I thought there is no way this can work. This week however, I stumbled across the following article written by Cesar Alvarez: https://alvarezquanttrading.com/blog/monthly-rotation-closeness-to-10/

So I wonder if Quantacula offers the possibility to map the following ranking ruleset?

Rank stocks by closeness to price under a multiple of 10 Rank value = The remainder of Close divided by 10 Price Buckets = Under $50 - Between $50 and $100 - Over $100

Attachment

Cancel

Responses

Hi Merlin,

I read the article, and it was my impression that Cesar determined that the method, in the end, did not have much value. But of course something like this would be possible in Quantacula. I could see this working in this fashion:

  • Create a custom indicator to calculate the rank.
  • Perhaps include a parameter for the desired bucket, if a symbol was outside the bucket set the indicator value to zero for that bar.
  • Use your custom indicator in a monthly Rotation Model.

It struck me that the introduction of buckets was a needless complication meant to overcome the problem of using the fixed modulo value for assets of widely varying price. Why not just create an indicator that returns the percentage distance that closing price is from the next 10 point boundary? Such an indicator would let you get a cleaner run without the complexity of price buckets, and you could rank the whole universe.

Hi Merlin, I read the article, and it was my impression that Cesar determined that the method, in the end, did not have much value. But of course something like this would be possible in Quantacula. I could see this working in this fashion: * Create a custom indicator to calculate the rank. * Perhaps include a parameter for the desired bucket, if a symbol was outside the bucket set the indicator value to zero for that bar. * Use your custom indicator in a monthly Rotation Model. It struck me that the introduction of buckets was a needless complication meant to overcome the problem of using the fixed modulo value for assets of widely varying price. Why not just create an indicator that returns the percentage distance that closing price is from the next 10 point boundary? Such an indicator would let you get a cleaner run without the complexity of price buckets, and you could rank the whole universe.

Unfortunately I don't know how to calculate and sort a list of stocks in a "coded" indicator. The only way I know is the "coded" rotation model. Calculation and sorting for the the percentage distance that closing price is from the next 10 point boundary could be done in the PreExecute Method.

Unfortunately I don't know how to calculate and sort a list of stocks in a "coded" indicator. The only way I know is the "coded" rotation model. Calculation and sorting for the the percentage distance that closing price is from the next 10 point boundary could be done in the PreExecute Method.

Yes, the idea is you'd create a new indicator that you would then use as the weight factor in a standard Rotation Model.

Yes, the idea is you'd create a new indicator that you would then use as the weight factor in a standard Rotation Model.

Hi Glitch, on the BarHistory Object, there's a UserData property which allows to store ad-hoc data. How can I store multiple custom values like an indicator value and a bucket rank?

Hi Glitch, on the BarHistory Object, there's a UserData property which allows to store ad-hoc data. How can I store multiple custom values like an indicator value and a bucket rank?

Hi Merlin, take a look at the Cache property. It is a Dictionary<string, object> that you can use to store ad-hoc objects (keyed by name) in a BarHistory.

Hi Merlin, take a look at the **Cache** property. It is a Dictionary<string, object> that you can use to store ad-hoc objects (keyed by name) in a BarHistory.
Forum Tips

Please sign in if you want to participate in our forum.

Our forum uses Markdown syntax to format posts.

To embed code snippets, enclose them in [CODE][/CODE] tags.