Announcement

Collapse
No announcement yet.

Referencing multiple timeframe variables on single chart

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

  • Referencing multiple timeframe variables on single chart

    Greetings,

    What is the proper way to reference values of a different interval chart inside of a chart of a different time interval?

    To elaborate, lets say I wanted to retrieve the current value of a simple moving average on a daily chart inside of an EFS script running 3 minute interval chart. How would one do this?

    I think this may have been covered before, so maybe just point me to the thread if that's the case.

    Thanks in advance,
    Joshua C. Bergeron

  • #2
    Hi,

    The feature you want isn't available YET (but they are working on it). There are several methods for accomplishing what you want to do however, though they are a bit more complex.

    In this specific case, since it is only an MA, I would use getValue() and just specify the symbol,interval you want:

    getValue(close, 0, 10, "IBM,10");

    This would get you the last 10 bars from an IBM 10 minute chart. You could then build a 10 period MA from that.

    This simple solution will work well in RT, but your historical information will not look correctly because we have done nothing to synch up the charts times. So if you want to draw the historical info correctly, or want to backtest your strategy, you will have to use:

    getValue("rawtime");
    getFirstBarIndexofDay();
    getValueAbsolute();

    to get the results you want.

    To see examples of this see the 30msh.efs under the Msl-msh subdirectory and the pivot studies under the pivot directory.

    All of these assume a smaller interval chart with a larger interval overlaid on it.

    You can also look at the twotimer.efs study Alex and I worked together on. Alex wrote up a very nice into to it, as there are cases where it works very well and gives a great template for users to add to, and other cases where other methods would be more appropriate.

    Garth
    Garth

    Comment

    Working...
    X