Request: Charting tool for percentage difference
Author: wantofly
Creation Date: 8/1/2009 2:34 PM
profile picture

wantofly

#1

If possible, I would like to have the following feature supported for the charting tools.

This would be similar to the trendline where a user specify a starting point and an end point, then a line would be drawn, but for this new feature, some annotation would be automatically added to calculate the percentage difference between the starting point and an end point. This would be particularly useful when an entry price has been set and some resistance level is identified on the chart, instead of punching calculators, all the user needs to do is to click the starting point and the end point on the chart.
profile picture

Cone

#2
v4 had that as an option, so I don't see why we haven't already done the same for v5. Please create a Support ticket to remind me to look into it. It sure would be a shame to have to create a new TL tool just for that feature.

If anyone else has ideas for new drawing tools, feel free to express them here. No promises, but I've got at least one I'd like to add, so it could be the basis of starting a new Community.DrawingTools extension.
profile picture

Cone

#3
It might be faster to use a calculator, but here's a mildly creative idea to avoid that. Let this script draw the line for you. You just need to specify the bar numbers in the sliders. I don't recommend using the sliders themselves, but instead, click the Label and enter the ber number directly (WL 5.3 and higher required for that).

The neat thing about doing it this way is that you can specify numbers just once, say at the March low for the first bar, and then just change symbols. You'll see the percent change for each symbol just by clicking for new charts, though the symbols need to have the same number of bars. Perhaps it would be better to make sliders for dates... left for homework!

CODE:
Please log in to see this code.


profile picture

wantofly

#4

Thanks for the quick reply.

What I desire to have is to be able to draw a line between any two points on the chart (e.g., any bar or moving average). The code you gave is similar to a reference price level. Since it is not intended for a new strategy, it doesn't need to be in Execute().
profile picture

Cone

#5
Of course I understand that. Did you read my first post?

The code is just a creative workaround that you can use right now, and, you can change the start and end points nearly as easily as you can redraw a line. Furthermore, it will be there for every symbol, for which you'd have to redraw if using a manual drawing tool.
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).