|  | 
| Text on Chart | 
| Post Reply   | 
| Author | |
| mcdirt   Newbie   Joined: 07 Oct 2004 Posts: 11 |  Post Options  Quote  Reply  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 | |
|  | |
| maximo   BullCharts Guru     Joined: 02 Sep 2006 Location: Australia Posts: 232 |  Post Options  Quote  Reply  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 | |
|  | |
| mcdirt   Newbie   Joined: 07 Oct 2004 Posts: 11 |  Post Options  Quote  Reply  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 | |
|  | |
| Post Reply   | 
| Forum Jump | Forum Permissions  You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |