Announcement

Collapse
No announcement yet.

Time indicator for Tick/Volume charts

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Time indicator for Tick/Volume charts

    Is it possible to make an indicator that plots the time for each individual tick or volume bar in histogram form with the time in the right scale and/or color changes on the histogram bar as the time reaches certain increments. For example, if it's less than 1 minute it's green.... if it's between 1 minute and 2 minutes its yellow, and so on.

    Thanks for any help!

  • #2
    opstock
    Probably the simplest way would be to time the difference in seconds between the last two bars ie
    var TimeDiff = rawtime(0)-rawtime(-1);
    and then set your conditions to color the bars based on the value of TimeDiff ie
    if(TimeDiff > 60 && TimeDiff < 120) setBarFgColor(Color.yellow) etc etc
    Return TimeDiff and in preMain set the plot type to histogram
    Alex

    Comment


    • #3
      Thanks much Alex, I'll give it a shot.

      Comment


      • #4
        opstock,
        did you ever get this EFS working? Could you post the code?

        Comment


        • #5
          Yes, here it is PJ
          Attached Files

          Comment

          Working...
          X