Announcement

Collapse
No announcement yet.

How to access Intraday Values

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

  • How to access Intraday Values

    I need help analyzing Intraday values (Such as minutes Last for ex.) while the chart is on Day time scale or weeks, and maybe 5 minutes

    Anybody tried that?

  • #2
    Hello aladin31,

    While on a daily chart, you can use getValue(barType, [nOffset], [ nNumBars], [sSymbol] )) and pass the interval for the intra-day price you want in the sSymbol parameter.

    getValue("Close", 0, -5, "IBM,5");

    This would give you the last 5 closes of the IBM 5 minute chart. However, this simple routine should only be used on the current bar (bar index 0) of your daily chart. It will not give you the result you need on the historical bars on load of the formula due to some synchronization issues. Before we go into that, let me know if you would need anything on a historical basis.
    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
      Jason,

      Thanks a million. Yes, I need to process all the available historical intraday, for each historical bar.

      I read about this sync pbm before. While I m new to e-signal, I think I have enough S/W experience to try to beat it.

      Can U help?

      Comment


      • #4
        Hello aladin31,

        I'll try to provide as much guidance as I can. First, give me some more specific details as to what you need to accomplish for the historical bars.
        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


        • #5
          Jason,
          For each daily bar, I would like to account for the intraday accumulation and distribution. I would like to know how the volumes sold at ask and volumes sold at bid. I also wanted to develop TVI indicator, based on the intraday information. TVI is for Trade Volume Index. Briefly, I am not satisfied using the day close and day volume to account for accumulation and distribution.

          Comment


          • #6
            Hello aladin31,

            We don't have bid and ask information exposed for historical bars so you won't be able to do that part. As for the TVI, what information from the intra-day data do you want to display for each daily bar?

            At any rate, the first thing that you need to do is get the first and last bar indexes of the day for the intraday interval. Here's a code snippet below to get you started. Keep in mind that the bar indexes returned are based on the 24-hour time template by default. We don't have a choice to set the time template through EFS. There is also a limited amount of days we can process looking at intraday intervals from a daily chart. It may not be enough for your needs depending on the intraday interval you want to use. To give you a rough idea, 1-min will be limited to about 2 days, 15-min interval will go back about 10 days, depending on the symbol. It's a limitation of our getFirstBarIndexOfDay(Date, Symbol) function.

            PHP Code:
            var vLastIndex null;
            var 
            vFirstIndex null;

            function 
            main(Interval) {
                if (
            Interval == nullInterval 10;
                if (
            getBarState()  == BARSTATE_NEWBAR) {
                    var 
            vBarTime getValue("time"); // daily bar
                    
            if(vBarTime != null) {
                        
            vFirstIndex getFirstBarIndexOfDay(vBarTime"IBM,"+Interval); // of intraday chart
                        
            if (getCurrentBarIndex() < 0) {
                            
            vLastIndex = -getFirstBarIndexOfDay(getValue("time"1), "IBM,"+Interval); // of intraday chart
                        
            } else {
                            var 
            vDate = new Date();
                            
            vLastIndex = -getFirstBarIndexOfDay(vDate"IBM,"+Interval); // of intraday chart
                        
            }
                        if(
            vFirstIndex != null && vLastIndex != null) {
                            
            debugPrintln(getCurrentBarIndex() + "  First :" vFirstIndex " Last: " vLastIndex);
                            if (
            getCurrentBarIndex() == 0) {
                                
            // first bar of day at aData[0]
                                //var aData = getValue("Close", vFirstIndex, (vLastIndex-vFirstIndex), "IBM,"+Interval);
                                
                                // last bar of day at aData[0]
                                
            var aData getValue("Close"vLastIndex, -(vLastIndex-vFirstIndex), "IBM,"+Interval);
                                
            debugPrintln(aData);
                            }
                        } 
                    }
                }

            Once you have the indexes for each day, you can get the intraday bar count and use getValue(barType, [offset], [numBars], [symbol]) to get the array of prices for a specific day.

            This example will give you an array of intraday prices where the oldest price, or first bar of the day is the [0] element of the array.
            getValue("Close", vFirstIndex, (vLastIndex+vFirstIndex), "IBM,"+Interval);

            If you want the most recent price, or last index of the day, to be the [0] element of the array, do this,
            getValue("Close", vLastIndex, -(vLastIndex+vFirstIndex), "IBM,"+Interval);

            You now have the array of price data to loop through and do your TVI calculations.
            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


            • #7
              Thank you Jason, this was very helpful

              However, I am disappointed with the number of days limit on intraday, because of getFirstBarIndexOfDay.

              TVI is complex, hwever, the idea is to look at the intraday periods, let's say 15 minutes, and sibtract the sum of low volumes from the sum of the high volumes. This gives you an idication of buy power over sell. By using the intraday data, you will be free from the last minute manipulation of the day bar, that may give you a close that is not indicative of the day's activity.

              Comment


              • #8
                Hello aladin31,

                To get the array of volume data, use "Volume" in place of "Close" in the getValue() function .
                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

                Working...
                X