Announcement

Collapse
No announcement yet.

EFS2 Multiple Time Frame Question

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

  • EFS2 Multiple Time Frame Question

    Quick question on how to approach something using the new multi-time frame capability.

    I am wanting to access 2 additional time frames from within a single chart. A time frame higher and a time frame lower.

    I need to be able to obtain hi/lo values for bars on each of these time frames, but not necessarily the current bar being created and coorelate those bars to bars on the current chart.

    My current efs perform advanced pattern recoginition without using indicators--on the actual bars themselves. What I'd like to do is conduct from a single chart pattern recognition in 3 time frames and be able to coorelate the 3 together for even more powerful pattern recognition in the form of fractal patterns within patterns. My problem is, I can't see with the new efs2 capability how to approach this. It appears as if the multi-time frame capability is really strictly for indicators, where as you create a data series based on another time frame's indicator.

    But what I need to do is be able to run my pattern routine on 3 times frames, and using the middle time frame be able to look at the other time frames and check the current pattern.

    I am a bit foggy on how to approach this using efs2.

    One thought was to change my routine to be a function that you call with a series, but this series would not be a single data item series like series of highs or MA, but rather a series of bar data(OHLC) and let the pattern recognition perform it's task and return it's current information as an object that I would then use to make my decisions.
    Question is can I do this. I see you can pass a different interval to your function using INV(), so I would have to pass my routine the INV() for all 3 time frames and then have to manually look for bar index values on each time frame that share the same hi/lo? Or is there an easier way of doing this?

    if someone has an example of how they identify shared lo/hi on multiple time frames and could post that code that would be great!

    thx

  • #2
    Re: EFS2 Multiple Time Frame Question

    Hello philli4093,

    Originally posted by philli4093
    Quick question on how to approach something using the new multi-time frame capability.

    I am wanting to access 2 additional time frames from within a single chart. A time frame higher and a time frame lower.

    I need to be able to obtain hi/lo values for bars on each of these time frames, but not necessarily the current bar being created and coorelate those bars to bars on the current chart.
    If you need the highest high for a certain number of bars, you could use the Donchian study functions. To have the series based on the external time frame and be synched to your current chart interval, pass the interval to the study with the inv() function. You will create this series using the efsInternal() function. By creating this series through efsInternal() you will be able to quickly reference this series historical values relative to your main chart's bar indexes. You would do the following inside main.

    PHP Code:
    function main() {
        var 
    series1 efsInternal("calc1"); 


    Create "calc1" as a user-defined function inside your formula code somewhere below main, which would look something like below.

    PHP Code:
    function calc1() {
        
    // or enter your custom calc here.
        
    return upperDonchian(10inv("15"));

    Create a separate series using this method for each interval you need, which will be synched to your main chart's interval. Then if you need to look at specific values from these series historically, use the .getValue(barIndex) method. The barIndex parameter in this case is relative to your current chart's bar index values.

    var myValue1 = series1.getValue(-10);

    or for the current value

    var myValue1 = series1.getValue(0);



    My current efs perform advanced pattern recoginition without using indicators--on the actual bars themselves. What I'd like to do is conduct from a single chart pattern recognition in 3 time frames and be able to coorelate the 3 together for even more powerful pattern recognition in the form of fractal patterns within patterns. My problem is, I can't see with the new efs2 capability how to approach this. It appears as if the multi-time frame capability is really strictly for indicators, where as you create a data series based on another time frame's indicator.

    But what I need to do is be able to run my pattern routine on 3 times frames, and using the middle time frame be able to look at the other time frames and check the current pattern.

    I am a bit foggy on how to approach this using efs2.
    You can access the OHLC data from external time frames in addition to built-in indicator series data. You can do this with a custom series, or indicators, as well. To access the high or low price bar values for specific bars on the external time frames you can pass the respective inv() to the high(inv("15")) or low(inv("15")) functions inside an efsInteranl() like we did in the previous example. These functions are also series functions like the built in studies. You could then use them the same way as series1 object above.

    I'm not sure how you are analyzing or correlating the data from the different time frames, but there is another route you could take. If your pattern formula returns values that you use to base conditions on, or identify patterns, then you could just call that formula through the efs() function. By passing the external interval through the sym/inv parameter, the resulting series will be based on the specified interval. You would do this for each time frame you need a series for. This should also be done inside an efsInternal() function call so your bar index references from the getValue() calls will be relative to your chart's index values.

    PHP Code:
    function main() {
        var 
    series1 efsInternal("calc1"15);  // 15 is the interval, which could also be a string.
        
    var myValue1 series1.getValue(0);
        ...
        ...
    }

      
    function 
    calc1(interval) {
        return 
    efs("myPattern.efs"0inv(interval));


    One thought was to change my routine to be a function that you call with a series, but this series would not be a single data item series like series of highs or MA, but rather a series of bar data(OHLC) and let the pattern recognition perform it's task and return it's current information as an object that I would then use to make my decisions.
    Question is can I do this. I see you can pass a different interval to your function using INV(), so I would have to pass my routine the INV() for all 3 time frames and then have to manually look for bar index values on each time frame that share the same hi/lo? Or is there an easier way of doing this?

    if someone has an example of how they identify shared lo/hi on multiple time frames and could post that code that would be great!

    thx
    To see if the external time-frames have a shared high/low, all you would need to do is a comparison. Once you have established all your series that you need to look at of course.

    PHP Code:
    if (series1.getValue(0) == series2.getValue(0)) {
       
    // we have a shared value at bar 0 of the main chart interval, execute this code.
       
    ...
       ...

    You just need to specify a negative bar index to look at the historical comparison instead of the 0 parameter above.


    It's a lot to absorb, but you asked for a lot. I hope this helps get you going in the right direction.
    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
      Thanks jason, the donchian idea is a great one I had not thought of and it spurred a thought in the fact that my real issue in looking at different timeframe ohlc data is being able to coorelate the relative offsets from the current bar. This is easily accomplished if the time frames have a fixed ratio like 3 i.e. 3/9/27 but if they do not it becomes difficult to correlate.

      as I need to keep track of # of bars between hi's and lo's in order to coorelate time of the swings in different time frames..

      You are right this is a lot, but you gave me something to think on.

      thanks
      Last edited by philli4093; 05-17-2005, 11:21 PM.

      Comment

      Working...
      X