Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Is it posssible to plot the second RECORD?

Hi,

Normally one plots a chart with record(...). I wonder if it is possible to plot two separated charts? I've tried followings but I still get one chart:

... record(chart1)
record(chart2)
...

Thomas

7 responses

I am not sure if your question is to have two separate plots, but the code below gives me all three data plotted and auto scaled.
record(vwap = vwap) #the first vwap is the name of the chart, and the second vwap is the variable with values
record(close = close, mavg = mavg_50)

I believe record() needs a name as argument. So you may want to try
record(chart1=chart1, chart2=chart2)

Thomas,
My understanding is that you get 1 chart, and up to 5 traces on that chart by using record You can put all 5 named or unnamed traces into one record statement, or use up to 5 record statements, with one trace each.
See:
https://www.quantopian.com/help#ide-record

alan

Hi Parshu,

You understand me correct. I do want to have plot a chart for each security. I think I did excatly as you did but I just get one chart for two securities. I attach my code. Could you have a look?

Many thanks!

Hi Alan,

I know what you told. But that is not what I want. Assumed I want to plot charts of tow securities. One has the price range about 700 USD, the other just about 20 USD. If you have these both in the same chart, what you can see of the second chart is just a horizontal line.

Hi Parshu,

You understand me correct. I do want to have plot a chart for each security. I think I did excatly as you did but I just get one chart for two securities. I attach my code. Could you have a look?

Thomas

Thomas,
Both traces are there, just at a different yaxis scale.
The Custom data box "auto scales" all the traces at once.
Click on the Custom data: legend colored box to "turn that trace off"....click it again to turn it on...
The other trace will then auto-scale, and fill up the box.
The way to see all the traces is to normalize them so that the scales are comparable, but then you lose the y-axis scale...

You can'rt really control much more than this on the backtest screen.
If you want much more control, use the research platform...if you want more than that, use the python zipline package and add ggplot or somesuch.

Personally, I modify something like Gary Ha's "pvr" code,
https://www.quantopian.com/posts/pvr-profit-vs-risk
and chose 5 traces to plot, then click on/off the various ones to see the others.

Good Luck,
alan

Hi Alan,

Many thanks!