Click here to Login





                                                   Relative rotation graph

  1

0
Alexander Horn
2014-09-24 11:55:09


Hi QS,

I'm wondering how I could graph something like this in QS charts. Any suggestion or similar thing done already?

y-axis is acceleration of RS momentum (% change), x-axis RS momentum itself.

http://allstarcharts.com/wp-content/uploads/2013/01/1-11-13-RRG-daily.png



QuantShare
2014-09-24 12:30:16

  0

Best Answer
We are working on a new advanced quantitative analysis tool that will allow you to draw something like that.


Mohsen Mouralli
2018-01-09 16:19:21

  0

Hello Any update of the RRG Graphing capabilities with QuantShare?


QuantShare
2018-01-10 08:31:32

  0

Unfortunately, this is something we have not implemented.


Josh McCormick
2020-09-06 14:18:22

  0

Hi! I know this is an old conversation, but I keep bumping into these unique graphs now and again and I absolutely love them. If I've got the chops, I wouldn't mind spending some of my own time to get something working in QuantShare! One small snag: a group called RRG Research which appears to have trademarked the name. But that's not a patent, so there doesn't seem to be anything getting in the way of making a copy of it. Only giving it the official name.

Anyhow, let me puzzle out here real quick what it might take to implement these...

I don't think the calculations themselves are going to be a problem. They're based on a benchmark and one or more securities. For each security you're plotting its relative strength (x axis) and its relative momentum (y axis) as compared to the benchmark. There are a number of webpages which describe it (in various levels of detail):

https://school.stockcharts.com/doku.php?id=chart_analysis:rrg_charts
https://www.stockcharts.com/articles/chartwatchers/2019/04/when-tails-remain-on-one-side-of-a-relative-rotation-graph-what-does-that-mean.html

...and I suspect there would be plenty of 3rd party scripts for one of the many other platforms that could be translated into QuantShare if it comes to that. With a formula in-hand, it's pretty easy to test it against a known reference to make sure it is giving good numbers. Here's one such online RRG Webtool...

https://stockcharts.com/freecharts/rrg/

The graph itself really isn't all that complex, is it? It is a standard X/Y plot with (0,0) in the middle (or 100%, 100% in the middle since we're comparing it to a benchmark at that position). This divides the graph into four named and color-coded quadrants which is very easy to handle. The only special added touch is the trail which is often applied to each of the securities that are plotted, but that isn't very challenging. The hard part though is trying to fit it into how QuantShare works. I'm hoping that Azouz might have some comments here.

Something like PlotFixed seems like an appropriate base to begin with because you don't want the plotted points shifting left/right as you scroll forward and backwards in time. (But you might want it to recalculate the graph each time you've moved to a new time period. That seems to make sense.) You'd need to color and to label the four quadrants, and that shouldn't be too tough either. I think the only hard part is actually doing the plotting itself? My experience with PlotFixed is that it wants to plot 'buckets' along the X axis and not so much as a linear number. So I'm not sure how to get smooth X,Y plots done (and then to label each of them).

*Azouz:*

How would you recommend going about creating a fixed plot (no horizontal scrolling) with (0,0) (or 100,100) in the center and the ability to plot (and hopefully label) any X,Y position on the graph? Being able to match something like this (perhaps adding in a "tail" of recent values) would be great:

https://school.stockcharts.com/lib/exe/fetch.php?media=chart_analysis:rrg_charts:rrgs-03-quandrants.png

It seems like it is going to take a bit more than the built-in QuantShare Script commands to pull this off. Are there some C# functions you'd recommend to someone who's interested in implementing this? (Is any existing downloadable going to make a good reference?) Or is it going to require some additions to QuantShare itself for these kind of graphs to happen?

PS: I noticed we've got the ZedGraph library which can be referenced when creating custom function. (Can a function with this reference be shared?) I've located a large cache of sample graphs, tutorials, and documentation for ZedGraph. This thing is more than capable for the job! If you could get me started with a blank FixedPlot kind of situation, I'm pretty confident that I'm going to be able to code a chart that Alexander, myself, and no doubt many others are interested in.

Let me know? This looks like fun!
Josh McCormick

DISCLAIMER (just to keep any lawyers happy):
Relative Rotation Graphs and RRG Charts are registered trademarks of RRG Research.



QuantShare
2020-09-07 13:17:59

  1

Unfortunately, this is not possible to achieve in QuantShare chart. You cannot also use any C# code to plot this on the QS chart.
You can create your own C# library using any chart library to draw these but in all cases, it will be displayed outside QuantShare chart.



Josh McCormick
2020-09-07 19:51:57

  0

Can't do it? CHALLENGE ACCEPTED. :)

https://i.imgur.com/31Ijbsv.png --- SCREENSHOT
https://i.imgur.com/zRIHek2.gif --- ANIMATED SCREENSHOT

But seriously, you were probably speaking specifically about the ZedGraph library. And I do have to ask you to forgive my ignorance here. I'm out of my depth. I've never programmed in a C# or in Windows environment before, so I appreciate your patience with my awkwardly probing questions!

Mind you, the code was set to add new elements to the chart at the same time I was scrolling. I had placed the box and the label a little out-of-bounds, but you get the idea. It is a complete part of the chart. It disappears very cleanly. You can scroll left-and-right on the timeline and it'll disappear and reappear like anything else.

As shown in the screenshot, with a custom script, I was able to draw a number of objects and attach them to the chart (scrolling off-screen and back on-screen as they should). I'm extremely confident that, from an appearance standpoint, I'm going to be able to create these relative rotation graphs. But... and you might have been referring to this as well...I wasn't able to tell QuantShare to draw these simple objects while I'm editing *a function*. Is this the limitation here?

If so, I'm thinking that retrieving the stock data and performing all the mathematical calculations could be done by a simple QS Formula or maybe a custom function. Once the results are processed, it could pass the ticker symbols and their relative X,Y positions to a QuantShare script (C#) which would have the ability to generate these stylized graphs (and have them fully integrated in the QuantShare interface just about the same as any other graph) . Such a script might always be running in the background, either waiting to detect the correct chart or function or waiting for data to be passed to it via some mechanism , and then it could plot one of these graphs, yes?

Other than that, I think I have just one follow-up question:

Does a custom function have the ability to launch or execute an existing script? Could I have a custom function do all of the analysis and then (with or without passing parameters to it) call a local script to actually do the rendering? I'm able to create the graphs just how I want them with everything that's built-in to QuantShare's user-created scripts. The problem just seems how the script is launched, and how the data is passed to it to get it to plot what we want. Thoughts?

UPDATE: It looks like I can create a custom function to do the calculation. To actually graph it, it looks like I'd call a local graphing script with a command like Global.ExecuteScript("RelativeRotation.azf") ... but that command doesn't pass any parameters to the script. So I figure that our data on what needs to be plotted could be communicated a number of different ways, but I'm thinking that they could be stored in global variables? I dunno. What do you think?


Thanks much,
Josh McCormick



Josh McCormick
2020-09-08 13:32:53

  0

Within limitations, I appear to be able to add graphical elements to existing charts, but I've run into a few questions. I'll take them to email.

Regarding an RRG indicator, my preliminary research says that part of the calculation involves a proprietary ranking of securities (which seems like an unnecessary choice from a technical perspective) making it difficult to reproduce precisely. BUT... if one really likes the concept of a rotational display (four quadrants created by a benchmark security in the middle, X axis with relative strength, y axis with relative momentum) then there's little preventing something different but equivalent from being produced. I suspect that most people like the concept and the layout more than the exact implementation. I'm still looking into it.



No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Relative Performance/Return Chart - Compare Several Assets/Stocks
Relative Performance Chart - Dynamic assets and index
Relative Volatility Index
Global Market Rotation Strategy V1.4
Global Market Rotation Strategy V1.0

How-to Lessons
How to plot the relative performance of several stocks/indices
How to quickly select stocks based on the last value of a databas...
How to create a screen
How to create histogram charts
How to create a moving average of an indicator

Related Forum Threads
Custom index/relative chart for TAA - Sector rotation
Symbol Strength Relative to Index
Error Graph should automatically scale
Stock or industry relative strenght : Indicator or composite ?
Graph trades

Blog Posts
Compare stocks and securities by creating a relative performance ...
Custom Indicator: Relative Strength
Create a Pivot Table that displays the Relative Strength Index - ...
Industry Analysis - How to Compare Stocks with their Industries
QuantShare Trading Software: New Features in the 3.4.2 Version









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.