Print Page | Close Window

ATR label at end of chart

Printed From: BullCharts Forum
Category: BullCharts
Forum Name: BullScript
Forum Discription: Technical discussion related specifically to the BullScript programming language.
URL: http://www.bullcharts.com.au/forum/forum_posts.asp?TID=149
Printed Date: 20 May 2024 at 11:14am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: ATR label at end of chart
Posted By: kneighbour
Subject: ATR label at end of chart
Date Posted: 23 Feb 2005 at 6:34pm

I want to put a bit of information at the end of the chart - ie on the current price action. ATR * 2 (or some multiple) would do for a start. I looked at how you did the Ex-Dividend date thing, and tried to modify that.

[target=Price]
[linestyle=text]
[textalign=Above,Right]
"ATR :" + ATR(14);

Unfortunatry this gives anexception error, although the syntax checks ok. I guess it is because I am trying to read a signal value, not just the last close. Something more like

"ATR :" + ATR(Security.close,14);

would seem to be the go - but this is not correct, of course.

Any hints?




Replies:
Posted By: Peter
Date Posted: 24 Feb 2005 at 11:08am
This will do the trick:

[target=Price]
[linestyle=text]
[textalign=Above,Right]
"ATR :" + ATR(14);
if(barnumber=lastvalue(barnumber),C,undefined);

A couple of things to note:
  1. When using the linestyle=text, you need to supply two results. The first determines the text, and the second determines the location (y-position). You get the excetion (which, granted, should appear a bit nicer) because it doesn't find enough results to work with.
  2. The indicator will draw text at every bar so long as both calculations return a result. If either calculation return undefined then you don't get text. This is why I have the barnumber=lastvalue(barnumber). etc..


Posted By: kneighbour
Date Posted: 24 Feb 2005 at 8:13pm

Ok - that works pretty good. Naturally enough, that is not all I want to do!

Here is the current version

ATRPeriod := input("ATR period",14,1,99);

ATRMultiplier = input("ATR multiplier",2,1,10);

[color = black]

[target=Volume]

[linestyle=text]

[textalign=Above,Center]

"ATR:"+ Round((ATR(ATRPeriod) / ATRMultiplier),2);

if(barnumber=lastvalue(barnumber),C,undefined);

 

Since the text is somewhat obtrusive on th emain price chart, I tried to put it on the Volume pane. It kind of works, but of course the scales are wrong. I can manually edit the properites to "Add new scale on left", but I do not see how to do this in code.

The second idea is to put the text on two lines...ie

ATR

0.21

Is there some way to do this? I do not see a linefeed character anywhere. In like vein - can I add more and more information to this indicator?  ie have two or three lines of data of some sort.

Can we put the information into the scale itself? ie the multi-color labels that appear in the price scale to mark the end of the charts.

 

 

 



Posted By: Tim Allen
Date Posted: 25 Feb 2005 at 10:03am
Originally posted by kneighbour

Since the text is somewhat obtrusive on th emain price chart, I tried to put it on the Volume pane. It kind of works, but of course the scales are wrong.

I bet that's because the 'location' value is still using 'Close' - if you plot the close value on the Volume scale, it's probably going to do something quite weird. If you make it use the Volume value instead (by changing the 'C' to a 'V' in the last line), I bet that will work much better.

Originally posted by kneighbour

The second idea is to put the text on two lines...ie

ATR

0.21

Is there some way to do this? I do not see a linefeed character anywhere.


You're right, there isn't a line-feed character, and so you can't force text onto multiple lines. I don't know whether Peter is likely to add a line-feed character - if we add too many text-formatting features we'll be basically rewriting Microsoft Word. ;)

Originally posted by kneighbour

In like vein - can I add more and more information to this indicator?ie have two or three lines of data of some sort.

I'm sure you can have as much data as you like by adding it to the end of the line that begins "ATR:" - with the caveat that it will stretch out horizontally.

Originally posted by kneighbour

Can we put the information into the scale itself? ie the multi-color labels that appear in the price scale to mark the end of the charts.

I expect that's not currently possible - but even if it were, wouldn't it obscure the scale-markings?



Posted By: kneighbour
Date Posted: 25 Feb 2005 at 5:19pm

Originally posted by kneighbour

Can we put the information into the scale itself? ie the multi-color labels that appear in the price scale to mark the end of the charts.

I expect that's not currently possible - but even if it were, wouldn't it obscure the scale-markings?

[/QUOTE]

Yes - which was to be the subject of another question - how can I turn off the indicator tags for a particular indicator?  I can turn them ALL off or on, but it does not seem like I can turn off individual tags.

The

 




Print Page | Close Window

Bulletin Board Software by Web Wiz Forums® version 9.69 - http://www.webwizforums.com
Copyright ©2001-2010 Web Wiz - http://www.webwiz.co.uk