BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: ATR label at end of chart
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

ATR label at end of chart

 Post Reply Post Reply
Author
Message / View First Unread Post
kneighbour View Drop Down
Regular
Regular
Avatar

Joined: 12 Feb 2005
Location: Australia
Posts: 57
Post Options Post Options   Quote kneighbour Quote  Post ReplyReply Direct Link To This Post Topic: ATR label at end of chart
    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?

Back to Top
Peter View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 09 Sep 2004
Location: Australia
Posts: 241
Post Options Post Options   Quote Peter Quote  Post ReplyReply Direct Link To This Post 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..
Back to Top
kneighbour View Drop Down
Regular
Regular
Avatar

Joined: 12 Feb 2005
Location: Australia
Posts: 57
Post Options Post Options   Quote kneighbour Quote  Post ReplyReply Direct Link To This Post 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.

 

 

 

Back to Top
Tim Allen View Drop Down
BullCharts Staff
BullCharts Staff
Avatar

Joined: 10 Sep 2004
Location: Australia
Posts: 53
Post Options Post Options   Quote Tim Allen Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
kneighbour View Drop Down
Regular
Regular
Avatar

Joined: 12 Feb 2005
Location: Australia
Posts: 57
Post Options Post Options   Quote kneighbour Quote  Post ReplyReply Direct Link To This Post 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

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz