Print Page | Close Window

Text on 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=742
Printed Date: 06 Apr 2025 at 3:00am
Software Version: Web Wiz Forums 9.69 - http://www.webwizforums.com


Topic: Text on Chart
Posted By: mcdirt
Subject: Text on Chart
Date 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;



Replies:
Posted By: maximo
Date 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;



Posted By: mcdirt
Date 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



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