Announcement

Collapse
No announcement yet.

first bar of the day

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

  • first bar of the day

    Hi,

    Is there any way to retrieve the high and low of the first bar on any time frame intraday for each day please?


    Thanks!

  • #2
    Re: first bar of the day

    Christophe
    There are several ways in which you can retrieve the values of the first bar of each day.
    One is to create a condition that looks for a bar that has a change in date and when that is true it retrieves the corresponding High and Low of that bar eg
    PHP Code:
    if(day(0)!=day(-1)){//this example assumes the first bar of the trading day is also the first bar of the day
        
    nHigh high(0)l//this would need to be a global variable
        
    nLow low(0);//as above

    Another is to create a condition that checks for the time of a bar to be equal to the starting time of a market and when that is true it retrieves the High and Low of that bar eg
    PHP Code:
    if((hour(0)*100)+minute(0)==930){//this example assumes the first bar is time stamped 9:30
        
    nHigh high(0);
        
    nLow low(0);

    For the description and syntax of the functions used in these examples see the Function Reference in the EFS KnowledgeBase. Also if you run a search through the forums you will find many more examples on how to accomplish what you are trying to do.
    If at any time you encounter a problem with your script post your code as you have written it and someone will be available to assist you
    Alex



    Originally posted by kwaks
    Hi,

    Is there any way to retrieve the high and low of the first bar on any time frame intraday for each day please?


    Thanks!

    Comment


    • #3
      Re:Re: first bar of the day

      Alexis,

      I used the second suggestion and that's spot on!

      Thanks a bunch for your help!

      Comment


      • #4
        Christophe
        You are most welcome
        Alex

        Comment

        Working...
        X