Announcement

Collapse
No announcement yet.

Valid External Time Intervals

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

  • Valid External Time Intervals

    Is there documented somewhere a list of valid External time Intervals and the correct syntax to use them?

    Is this correct?
    getBarStateInterval("30S")
    because it does not work [stuck on "Loading..")

    Thank you
    Mihai
    Mihai Buta

  • #2
    Mihai
    You can use any of the intervals that you would use to create a chart.
    For the syntax run a search for getBarStateInterval in the EFS KnowledgeBase.
    To answer your specific question 30S is valid and works (see the enclosed image which was created running the following script on a 5 seconds chart)

    PHP Code:
    function preMain(){
        
    setPriceStudy(false);
        
    setStudyTitle("getBarStateInterval 30s");
    }
    function 
    main(){
        if(
    getBarStateInterval("30s")==BARSTATE_NEWBAR){
            
    debugPrintln(getHour()+":"+getMinute()+":"+getSecond());
            
    drawShape(Shape.CIRCLE,BottomRow1,Color.red);
        }
        return 
    close(0);

    When using an external interval you need to consider that this is akin to loading a chart for that interval. With tick based charts (such as a seconds chart) this means that you will be downloading data in segments of a whole day (and for the number of days you have set in the Time Template) which may take some time
    Alex

    Comment


    • #3
      Thank you Alex,

      It did work this morning, in real time.
      [I don't know why did not last night.]

      Mihai
      Mihai Buta

      Comment

      Working...
      X