Announcement

Collapse
No announcement yet.

Rawtime to barindex conversion question

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rawtime to barindex conversion question

    Hi - is there an effective method to convert a rawtime value back to a barindex (effectively the reverse of a getValue("rawtime") ).

    My script identifies specific setups and pushes these "setups" onto an array using the rawtime value as the index will keep changing.

    On specific events I need to refer back to this data in the array and plot this on the chart at the original time. I understand that I need to convert the rawtime back to an barindex value to be able to do so.

    I am fairly new to EFS - but have read the manuals and reviewed the KB without an obvious answer.

    I would really appreciate some guidance.

    Thanks in advance.

    Lex

  • #2
    Re: Rawtime to barindex conversion question

    Lex
    In his dsUtilities.efsLib function library which you can find here Chris Kryza provides a dsgetBarIndexAtRawtime() function that seems to do what you are looking for
    Alex


    Originally posted by luthor
    Hi - is there an effective method to convert a rawtime value back to a barindex (effectively the reverse of a getValue("rawtime") ).

    My script identifies specific setups and pushes these "setups" onto an array using the rawtime value as the index will keep changing.

    On specific events I need to refer back to this data in the array and plot this on the chart at the original time. I understand that I need to convert the rawtime back to an barindex value to be able to do so.

    I am fairly new to EFS - but have read the manuals and reviewed the KB without an obvious answer.

    I would really appreciate some guidance.

    Thanks in advance.

    Lex

    Comment


    • #3
      Re: Rawtime to barindex conversion question

      Lex
      Alternatively instead of saving the rawtime value you could save the value returned by the getCurrentBarCount() function. Then when you need to refer back to that data you could just calculate the difference between the current bar count and the value you saved which will be the bart index relative to the current bar
      Alex

      Comment

      Working...
      X