Performance Comparison of Two Stocks
Author: mjdaumer
Creation Date: 10/25/2013 3:39 PM
profile picture

mjdaumer

#1
I am looking for a strategy that charts the performance of two or more tickers. Is there such a study available for WLP?

Mike
profile picture

Eugene

#2
profile picture

mjdaumer

#3
Both are very close to what I was looking for. Is there anyway to redefine the review period automatically to fit the period displayed in the chart. That is, the starting date would automatically adjust to left most bar displayed as the chart is re-sized.

Mike
profile picture

Eugene

#4
Did not understand the connection of resizing the chart and lookback period.
profile picture

mjdaumer

#5
I guess what I am trying to request is that the relative performance graph should always reset to zero at the left of the chart. If the chart opens with a six month daily view then the relative performance would display performance over a six month period. Zooming in or out would adjust the performance period accordingly but the starting point would remain anchored at zero.
profile picture

Eugene

#6
Got it. The 1st example allows itself to be easily modified to always accept the first bar's date as it already contains starting date parameter. Replace one last line with the two:

CODE:
Please log in to see this code.


It won't work when "All Data" is selected but for other data loading ranges should do.
profile picture

mjdaumer

#7
I see the difference between to two versions and it's closer to what I am looking for. Is it possible to re-scale to zero from the first visible bar in the chart as opposed to the first bar in the range. The zero point always remains anchored at the first visible bar thus displaying performance for the period displayed as the chart is zoomed in or out.

Mike
profile picture

Eugene

#8
Yes it's possible:

CODE:
Please log in to see this code.


It's impossible to rescale on increasing/decreasing bar spacing because a zoom event doesn't re-execute Strategy. So, you will have to F5 or click 'Go' every time the bar spacing is changed by mouse wheel or from the toolstrip.
profile picture

mjdaumer

#9
That is exactly what I needed. Thank you very much.

Mike
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).