Hi,
I would like to plot ROC(or any other indicator) in ONE SINGLE pane of all the symbols from a dataset. e.g. suppose I have IBM,AAPL,INTC in a dataset and i would like to plot ROC for each one of them on top of each other. I tried searching for it in forum but did not see it, if this had been discussed before, please point me to the aapropriate topic. Thank you.
Size:
Color:
Hi,
Here you go:
CODE:
Please log in to see this code.
See the WealthScript Programming Guide >
Indicators > Indicators of Secondary Symbols and look up
DataSetSymbols the QuickRef.
Size:
Color:
Thank Eugene,
As usual ur extremly helpful & ........................................etc. ;:)
Size:
Color:
Would this provide the same results as "performance charts," where one can compare the relative performance of various symbols over time, using the same price/time axes and the same beginning x/y coordinates? I have been wondering how to do this. I currently obtain that information by an online vendor, but I am limited to daily data. I would like to be able to do this for hourly data.
Thanks-
Rick
Size:
Color:
Size:
Color:
Here's Relative Performance Charting of all symbols from a DataSet:
CODE:
Please log in to see this code.
Size:
Color:
Sorry for the stupid question, but I tried to copy and paste this code into the editor, but it all appeared on one line. What do I need to do to keep the formating as it appears in the post?
Thanks-
Rick
Size:
Color:
Also, when I ran the ROC comparison it worked, but when I ran the above code for the Relative Performance Charts on the same data set, I got the following messages:
Error processing symbol UWM DataSeries do not have equal number of values for mathematical operation
Error processing symbol UXI DataSeries do not have equal number of values for mathematical operation
Error processing symbol UYM DataSeries do not have equal number of values for mathematical operation
Error processing symbol VAW DataSeries do not have equal number of values for mathematical operation
Error processing symbol VUG DataSeries do not have equal number of values for mathematical operation
Error processing symbol WOOD DataSeries do not have equal number of values for mathematical operation
Thanks for your help.
-Rick
Size:
Color:
Size:
Color:
Thanks, Eugene for the link. In order to compare the performance the symbols in a data set over a specific timeframe, is it possible to modify the code so that all the symbols begin at the same x-axis coordinate- e.g., at the median value of the x-axis range, with the x-axis values being percentages, and the values ranging from the highest percentage gain (or loss) in the data set on top to the lowest percentage gain (loss)?
-Rick
Size:
Color:
In code #2, all the symbols already start from the same coordinate (i.e. 0), the x-axis will always be "time", and the "y" axis is always a percentage. Seems like I don't understand what is the point of assigning percentages to the x-axis, what will be the y-axis then, and consequently, what you're after.
Size:
Color:
Eugene-
Sorry- I meant for them to start at the same point on the "y" axis, or at % = 0. This more easily allows direct comparisons of the various symbols in the data set over time, because they are all beginning at the same point- 0%. Can this be accomplished?
Size:
Color:
But they do start at the very same point = 0% - speaking about code #2. On which DataSet do you run it, what are your bar scale and data loading settings?
Size:
Color:
Based on you last comments, I compressed the bars to get all the chart's data on one screen.
One issue I have discovered is that if I try to run some data sets in too short a time frame, such as 20 days of data with 30-minute bars, I get the error message, "Runtime error: DataSeries do not have equal number of values for mathematical operation
at WealthLab.Strategies.MyStrategy.Execute()
at WealthLab.DataSeries.op_RightShift(DataSeries ds1.Int32value)
even though all data in the set is supposed to be 15-minute data. If I increase the time period, say to 30 days, I can get the chart, but since I am interested in shorter time scales, such as the last 10 days, how can I avoid having too long a time scale on the chart without getting the error message? My data should be current, since I updated all my data this evening.
Also, is there a way that I can provice a screenshot to show you what I am getting? Some of the results are hart to describe.
Size:
Color:
QUOTE:
at WealthLab.DataSeries.op_RightShift(DataSeries ds1.Int32value)
If you rewrite this snippet:
CODE:
Please log in to see this code.
This way:
CODE:
Please log in to see this code.
It will get slower, but does the error persist? I can't reproduce it either way on a DataSet where the symbols are up to date, start from the same date, on demand update turned off.
QUOTE:
Also, is there a way that I can provice a screenshot to show you what I am getting?
Any image hoster on the web + link for the uploaded image they provide = paste it between a pair of
IMG tags (right next to CODE, QUOTE...)
Size:
Color:
Size:
Color:
I could not get the pictures as it prompts me to log in. Let me kindly suggest you for the future, to use any free image hoster that doesn't require logging in and provides direct image links. The only step left then is to paste that link between a pair of IMG tags. To name a few:
tinypic.com, imagebam.com, imageshack.us.
QUOTE:
the chart do begin at y coordinate = 0, but at the first x coordinate they jump to other values
Try changing the starting date. If they won't "jump", then there was probably a gap, or the data for symbols doesn't start at the same date (synchronization).
QUOTE:
Also, when change the time frame to 60-minutes, I get no plots:
Sorry, can't tell, haven't seen the picture and do not know there's enough data loaded for all the symbols.
Size:
Color:
Ok- let's see if the images appear now...
Two things-
When I run the new code the symbols on the chart do begin at y coordinate = 0, but at the first x coordinate they jump to other values and don't look as I expected them to;
The default time frame for this data set is 15-minutes.
Also, when change the time frame to Daily bars, I get no plots:
Any thoughts?
Size:
Color:
Thank you for posting these images. Please re-read my commentary above from 3/26/2010 8:25 AM. I can't add much to what's already said there.
QUOTE:
Also, when change the time frame to Daily bars, I get no plots:
Like already suggested above: not enough data. 12 months is just 252 trading days while the code requires at least 260 bars of data just to warm up. It is up to you to edit the code so it would reflect your trading horizon.
QUOTE:
but at the first x coordinate they jump to other values and don't look as I expected them to;
Try changing the starting date. If they won't "jump", then there was probably a gap, or the data for symbols doesn't start at the same date (synchronization).
Size:
Color:
Thanks for all your help so far.
I'm still having some problems with the appearance of the comparison charts. Note the chart below:
The flat-line lead is present in all timeframes, and it is always the first symbol ine the data set. If I change data sets, it is still there, and if I delete the first symbol in the data set, then the next first symbol is "flat lined."
I appreciate your continued help.
Size:
Color:
QUOTE:
The flat-line lead is present in all timeframes, and it is always the first symbol ine the data set. If I change data sets, it is still there, and if I delete the first symbol in the data set, then the next first symbol is "flat lined."
The flat line is absolutely expected, it lasts for the first 260 bars of data (note: it's the Daily bar scale thing, probably related to approx. 250-260 trading sessions in a year. Does 260 have specific meaning for you on 15-minute charts? If so, that's fine by me.) These 260 bars - or whichever value the StartBar takes - are the seed data required to build the indicator series.
Size:
Color:
Eugene-
There is no reason for the 260-bars of seed data. It remains from the first code you wrote for this strategy, which was based on daily bars.
What is the rule of thumb for the amount of seed data necessary for any given timeframe for this kind of chart? I use multiple time frames in analysis, so I am inclined to use data anywhere from 5-minute bars to daily bars. I understand data integrity requirements for moving averages, but what is the data integrity requirement for a performance comparison chart?
Thanks
Size:
Color:
QUOTE:
What is the rule of thumb for the amount of seed data necessary for any given timeframe for this kind of chart? I
The amount of seed data entirely depends on the specified ROC period (e.g. 260 bars) which measures the security's performance over N bars.
Size:
Color:
I am sorry for all the questions, but if you would indulge one more: Since I have inadvertently highjacked this thread into one about relative price performance rather than ROC, is any seed data even required for relative price performance, since no historical data is required to calculate price?
Size:
Color:
Good point. No, if your formula calculates relative price performance starting from bar 0.
Size:
Color:
From your question, I think you're probably looking for a different formula - other than the trailing relative performance (compared to shifted value of a series 260 bars ago):
CODE:
Please log in to see this code.
Try changing that line to this to compare relative performance to the very first bar:
CODE:
Please log in to see this code.
Or even substitute the "StartBar" here to a different starting bar number:
CODE:
Please log in to see this code.
Size:
Color:
Voila'!!
The line, rocList.Add( ( extClose - (extClose[StartBar]) ) / (extClose[StartBar]) * 100.0 );
produced exactly what I wanted. I and my equity curve both thank you!
-Rick
Size:
Color:
Rick,
That's good news to hear. :)
Size:
Color:
Hello Eugene
Can you please help me by modifying the code you provided by making the following changes
1) the default pricepane is hidden and all the curves are plotted on a single pane
2) plot the growth on a hypothetical $10,000 over a given period when start date is given as an input in the code
Thanks in advance
Size:
Color:
QUOTE:
1) the default pricepane is hidden and all the curves are plotted on a single pane
Hiding the PricePane isn't allowed but there's a workaround. As usual, you can find them in our Knowledge Base (a.k.a. Wealth-Lab Wiki):
FAQ | Strategies and WealthScript >
I want to chart an indicator, but without the stock price. Can I hide the PricePane?Now to the 2nd part of your request, that makes it no longer align with topic's title i.e. "Plotting ROC of multiple symbols..."
Size:
Color: