BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Text on Chart
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Text on Chart

 Post Reply Post Reply
Author
Message / View First Unread Post
mcdirt View Drop Down
Newbie
Newbie


Joined: 07 Oct 2004
Posts: 11
Post Options Post Options   Quote mcdirt Quote  Post ReplyReply Direct Link To This Post Topic: Text on Chart
    Posted: 19 Sep 2011 at 2:42pm
Hi,

I'm trying to write a simple Indicator that will show on the chart how many days since a trade has been entered. It doesn't work & I cannot get the syntax right so would apprecaiate any help.

Code I have  ...

td:=inputdate("Trade Date");
txt:=if(barnumber=lastvalue(barnumber),datediff(td,now)+"Days in Trade",undefined);

[target=price]
[linestyle=text]
txt;


Edited by mcdirt - 19 Sep 2011 at 2:43pm
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post Posted: 23 Sep 2011 at 6:32am
Okay this should do it.
 

Purchasedate:=inputdate("Purchase Date");

Bars:=datediff("D", Purchasedate, systemdate) + 1;

[linestyle=Text; textalign=Above,Center; target=price]

if(barnumber=lastvalue(barnumber), int(Bars) + " ", undefined);

High;



Edited by maximo - 23 Sep 2011 at 6:40am
Back to Top
mcdirt View Drop Down
Newbie
Newbie


Joined: 07 Oct 2004
Posts: 11
Post Options Post Options   Quote mcdirt Quote  Post ReplyReply Direct Link To This Post Posted: 23 Sep 2011 at 6:44pm
Thanks Maximo,

Many thanks, understand the mistakes in my code now. Shame BullScript does not allow placement of text anywhere on the screen (like MetaTrader does) that would allow some very nice info to be displayed on screen.

Thanks again
rgds mcdirt
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