Displaying several charts on the same screen
Author: BostonFern123
Creation Date: 2/3/2011 3:43 AM
profile picture

BostonFern123

#1
I would like to write codes to display several charts on the same screen.

The charts would be for different periods of the same stock, or the same period of different stocks, or different periods of different stocks. Since my intention is to compare charts, I would like to have the Y-axis to be a percentage instead of value.

How do I do this?
profile picture

Cone

#2
1. CreatePane to plot your symbol comparisons
2. GetExternalSymbol for each symbol you're interested in
3. Calculate the DataSeries
4. Plot them in the pane created in #1

There's always a primary symbol and the scale of its axis can't be changed (except to make it bigger with SetPaneMinMax), so you have to do this in another pane.
profile picture

BostonFern123

#3
Thank you, Cone, for your fast response.

My primitive understanding of "pane": it's a horizontal chart. I'm using a laptop, and most of laptop these days have wide screens, which means I will end up with a bunch of short-and-wide charts. This is not going to be easy for my eyes. Is there any way that I can draw 2 or 3 charts side by side with one another?
profile picture

BostonFern123

#4
I forgot another question.

It seems that this "CreatePane" method can only allow me to display data series of the same time frame. Is there a way to specify different beginning date and ending date for each chart?
profile picture

Cone

#5
QUOTE:
Is there any way that I can draw 2 or 3 charts side by side with one another?
Not in the same chart window, but you can click Window > Tile Vertically

QUOTE:
Is there a way to specify different beginning date and ending date for each chart?
Click on the chart to put it in focus, and set the data range using the Data Loading (Data Range) Control atop the Data Panel. If any of these terms are "Greek" to you, then please see User Guide > Reference > Data Panel
profile picture

BostonFern123

#6
Thanks.

These are "manual" methods for drawing charts side by side, and having a set beginning and ending date. I'm looking for an automated way to draw all these charts. Can they be done by "codes"? If yes, how?
profile picture

Cone

#7
Let's start over. You want to put some comparisons on the same chart with the same scaling. What are the symbols and how do you want to compare them? Be precise, because code is precise.
profile picture

BostonFern123

#8
The codes should be able to display multiple charts on the same screen, not just one chart. One chart for one symbol and one period. The y-axis should be the percentage gain since the first open of the chart.

An example of daily charts:

INTC, AAPL, SPY for the last 4 weeks. These 3 charts should be side-by-side.
GLD , gdx , gdxj for the last 2 weeks. These 3 charts should be side-by-side.



profile picture

Cone

#9
Okay, when you say "multiple charts", your really mean "multiple plots" in the same chart pane. Just click on a symbol with 4 weeks of data.

CODE:
Please log in to see this code.
profile picture

wmrgrove

#10
Found this thread to answer my question about "compare charts" and the code works fine as posted.

Two questions please;

When I add additional symbols to the compare chart I get the following error; "Runtime error, index was outside the bounds of the array"
Symbol data is fine and any combo of 3 tickers works. Am I doing something wrong or is this a limitation of the software?

2nd question; Are chart enhancements planned for future release that will upgrade this capability, like Fidelity active trader pro that has nice symbol compare capabilities?

Thanks, Bill
profile picture

Eugene

#11
QUOTE:
Am I doing something wrong or is this a limitation of the software?

Certainly you're doing something wrong:

Errors | Strategy > Index was out of range
QUOTE:
Are chart enhancements planned for future release that will upgrade this capability,

None that I'm aware of. Wealth-Lab is primarily a systematic backtesting/trading platform, and a charting package in the second place. What's wrong with doing it via code?
profile picture

wmrgrove

#12
Eugene, thanks! Figured it out, needed colors assigned to added symbols!

You asked, "What's wrong with doing it via code?" Nothing just the process a little more time consuming.

Is there a place where color options are listed (correct format/text) ?
profile picture

Eugene

#13
You're welcome.
QUOTE:
Is there a place where color options are listed (correct format/text) ?

Yes, there are lists and color tables of .NET colors. (Don't forget about transparency effects with Color.FromArgb). Just google for something like ".NET Color table" - there's nothing Wealth-Lab specific, that's why you won't find it in User/WealthScript Guides.
profile picture

wmrgrove

#14
Thanks Eugene!

I actually like the WL multi-symbol-compare charts once I've used them! A nice feature is that when you put the cursor on the symbol line it gives you the ticker name! This is nice since 50% of all men are somewhat colorblind.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).