Announcement

Collapse
No announcement yet.

getSeries vs getValues

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

  • getSeries vs getValues

    Good Morning,

    The following codes differ by the getSeries and getValues commands. I was under the impression the getValues command would return values for the longer period moving average on each tick of the shorter period on the chart. I have tested this and find both codes return the same results. Is there an error in the code?

    Best Regards,

    Alan

    /************************************************** *******
    Code1 test of getSeries
    ************************************************** ********/

    function preMain() {

    setPriceStudy(false);
    setStudyTitle("Code1");
    setCursorLabelName("Code1",0);
    setDefaultBarStyle(PS_SOLID, 0);
    setDefaultBarFgColor(Color.blue, 0);
    setDefaultBarThickness(2, 0);
    setPlotType(PLOTTYPE_LINE, 0);

    Symbol1 = "YM U5";
    Interval1 = "80T";

    }


    function main() {

    var vSymbol1 = Symbol1+","+Interval1;
    xMA1 = offsetSeries(eval(sma)(5,eval(high)(sym(vSymbol1)) ),0);
    return getSeries(xMA1);
    }


    /************************************************** *******
    Code2 test of getSeries
    ************************************************** ********/

    function preMain() {

    setPriceStudy(false);
    setStudyTitle("Code2");
    setCursorLabelName("Code2",0);
    setDefaultBarStyle(PS_SOLID, 0);
    setDefaultBarFgColor(Color.blue, 0);
    setDefaultBarThickness(2, 0);
    setPlotType(PLOTTYPE_LINE, 0);

    Symbol1 = "YM U5";
    Interval1 = "80T";

    }


    function main() {

    var vSymbol1 = Symbol1+","+Interval1;
    xMA1 = offsetSeries(eval(sma)(5,eval(high)(sym(vSymbol1)) ),0);
    return xMA1.getValue(0);
    }

  • #2
    Alan
    The values returned by getSeries() or getValue() will be exactly the same on current bar and on the historical bars when the efs is first loaded (or reloaded). In real time getValue() will store on each bar the value of the external interval at that time while getSeries() will back adjust those values to the current value. If you run a search using getSeries* as the keyword you will find several posts/threads on this subject explaining the difference
    Alex

    Comment


    • #3
      get Values

      Thank you as always for the guidance.

      I was away from my desk for an hour and when I returned I saw the differences in the real time data which had been processed after loading the two codes. When I reloaded the getValue code the differences disappeared as you indicated and then started to diverge.

      I changed the symbol name to $PLAYBACK and ran the same test and saw the differences in the data and the data change after a reload.

      1) If I log in at 11 AM and want to see what happened since the 9:30 AM opening, is there a way to reprocess the morning data other than using the playback mode to see the differences in getValues?

      2) If I start at 9:30 AM processing real time data, can the data be stored in an array, series, file etc. and then reload mid-day and merged and registered real time with the current data?

      3) With a single account, can I run playback and real time data at the same time on one computer? Two computers with a single internet connection?

      The reason for the lenghtly questions and testing is I find the getValues and global data provides much better resolution than getSeries. I am merely trying to find the best configuration for data processing.

      Best Regards,

      Alan

      Comment


      • #4
        Alan
        1) Not that I know of.
        2) I suppose you can store the data to a file and then read from it but I suspect it would not be a trivial task.
        3) You can run Tick Replay at any time (even while connected in real time)
        Alex

        Comment


        • #5
          getValues

          Thank you for the support. Have a great day!

          Best Regards,

          Alan

          Comment

          Working...
          X