Allows to set an absciss with a datetime instead of a candlestick barindex for Graphical instructions.
Accepted formats for date are YYYY / YYYYMM / YYYYMMDD / YYYYMMDDHH / YYYYMMDDHHMM / YYYYMMDDHHMMSS
Syntax:
1 |
DateToBarindex(20200101) |
Example: DRAWTEXT(“text”, DateToBarindex(20200101), close)
Example:
1 2 3 4 5 6 7 8 |
defparam drawonlastbaronly=true mydate = 20210630 drawsegment(datetobarindex(20200101),close,datetobarindex(mydate),highest[54](high)) drawtext("#mydate#",datetobarindex(mydate),highest[54](high),dialog,bold,30) coloured(255,0,0) return |