Date and time for drawtext

Forums ProRealTime English forum ProBuilder support Date and time for drawtext

Viewing 2 posts - 1 through 2 (of 2 total)
  • #37285

    Hi. Hope someone can understand and maybe help me

    I have made an simple indicator who shows the highs and low in a chart.

    I use “drawtext “to write date or time for the highs and lows

    The problem is I don’t find the right code for time and date. For time I would like to show hhmm as 09.00, 10.20 and so on. Not only 9 or 10.2.

    And for date as 04 May, 10 April and so on.  For date I have wrote as this

    a=(opendate[2]/1000)
    DRAWTEXT(“#a#”, BarIndex[2], high[2]+4, dialog,bold,12) This not work good Shows on the screen like this 20,170.523

    and for time as this
    a=OpenTime[2]/10000
    DRAWTEXT(“#a#”, BarIndex[2], high[2]+0.5, dialog,Bold,12) Time is ok but can be better.

    /Goeran

    #37317

    Variables can’t store strings. So you’ll always get numbers for months for example. Unless you make a conditional statement for each month : if month=4 then DRAWTEXT (“April”, …)

    Why not use Day + Month + Year to write the date instead of OpenDate? Same for OpenTime, you could use Hour + Minute instead.

Viewing 2 posts - 1 through 2 (of 2 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login