Announcement

Collapse
No announcement yet.

rawtime(0) Question

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

  • rawtime(0) Question

    esignal DOC is not clear to me on this issue.

    If I save a live trade signal, given by Systemsymbol on my 1-min chart to a price and bar using rawtime(0), and save that date to a text file in the form of:

    SystemHappyFace
    1.19009
    1141775580

    then I have saved the **exact second** of a particular minute (60 sec to a minute) that signal was generated. For sake of discussion, lets say that occured at 8:45:34.

    Now, If I wanted to redraw that symbol later on on a chart, for backtesting purposes and review, I would open a 1min chart and read this data in.

    But in past time, there are just minute bars and no seconds are ticking away, so that specific second that the rawtime(0) command captured (34th second) , will it exist and will the symbol be drawn on the correct minute bar (45th minute) even if the rawtime command captured the exact 34th second of that minute?

  • #2
    Hello Alex,

    Your understanding of rawtime(0) is incorrect. This function represents the start time of the bar in seconds from 1/1/1970. It does not return the time of when your signal occurs based on your pc clock. In your example with the one minute chart where the start time of the bar was 08:45:00, rawtime(0) will return the same number for the entire duration of that bar. It does not change every second. Try running the following on your one minute chart.

    function main() {
    var myTime = rawtime(0);
    return myTime;
    }

    Using rawtime(0) is just a quicker way of recording the time stamp (or start time) of a bar. Your other option would be to grab the hour, minute and second from the time stamp and build a string in hh:mm:ss to record the time stamp. But that is more work.
    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Originally posted by JasonK
      Hello Alex,

      This function represents the start time of the bar in seconds from 1/1/1970. It does not return the time of when your signal occurs based on your pc clock.
      "rawtime is the number of seconds elapsed since 1/1/1970." --this is exactly what eSignal DOC says, and it is not clear from this that this is refering only to start of bar


      "...start time of bar" -- OK, thanks for clarification

      Comment

      Working...
      X