Announcement

Collapse
No announcement yet.

Multi-Interval Reference using Close Bars

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

  • Multi-Interval Reference using Close Bars

    I am trying to perform calculations based upon different symbols and different intervals and based only on closed bars.

    So here is a simplification of my algorithm:

    Look at sma for symbol "INTC" for intervals 5, and 10.

    when sma(sym("INTC", 5)) for bar(0) == 10,
    I look at sma(sym("INTC", 10)) for bar(0) and wait for it to hit 15.

    when sma(sym("INTC", 10)) for bar(0) hits 15, I look back at
    sma(sym("INTC", 5)) for bar(0) and wait for it to drop below 5.

    At that point, I print something to the output window.

    I am doing this all from one EFS script that contains both series.
    But ticks will only come in at the interval of the chart that has that EFS loaded, correct?

    So, how do I essentially get close ticks for multiple intervals, which could even be different from interval for the chart where the EFS runs??

    Do I have to run a separate EFS from a chart that corresponds to each interval, so I have a 5 minute chart that receives close ticks every 10 minutes and a 10 min. chart that receives ticks every 10 min.?

    And then when a condition occurs in either EFS, it sets a global var. with that condition, which the other EFS can monitor while it continues to process close ticks? So in effect, either EFS has access to the latest state of the other EFS through global vars. That is how they link together.

    Does that make sense? It sounds like it should work but seems rather complicated. I don't see an easier way.

  • #2
    Also, what about using more than 7 series in one EFS?

    Say I have three timeframes (5, 10, and 15 min.) , 2 symbols, and 2 different indicators to monitor. That equals 12 separate series or 12 separate vars to maintain.

    But EFS2 only allows me to hold into max. 7 series in one EFS.

    Of course I could load multiple EFS scripts in the same chart to do this but I get back to the issue that requires receiving ticks for each interval separately so loading multiple EFS scripts into 1 chart is not what I want to do.

    How do I get around this? Just like the first post I made for this topic, do I have to load multiple charts with one EFS in each one to get past this limit, using global vars to communicate between the scripts?

    Comment


    • #3
      My Understanding After Reading More Threads

      It looks like if I want to examine series for different indicators using the same symbol but different timeframes, and being able to process close bars as they come in for each interval,
      I will have to load a separate EFS into a separate chart for each interval.

      Only that way can I process bars when they arrive for each interval. Someone said they have done this and just minimized the windows for the lower timeframes if they just want to see a consolidation of the information on the bigger interval.

      But what if I don't want to reveal some of those charts to the user if they are using my EFS scripts? I don't want to reveal some of the timeframes to them, just a bigger timeframe which is annotated with stats from the other charts. Can I hide those charts somehow from the user?

      Comment


      • #4
        Re: Multi-Interval Reference using Close Bars

        Hello crazytiger,

        Originally posted by crazytiger
        I am trying to perform calculations based upon different symbols and different intervals and based only on closed bars.

        So here is a simplification of my algorithm:

        Look at sma for symbol "INTC" for intervals 5, and 10.

        when sma(sym("INTC", 5)) for bar(0) == 10,
        I look at sma(sym("INTC", 10)) for bar(0) and wait for it to hit 15.

        when sma(sym("INTC", 10)) for bar(0) hits 15, I look back at
        sma(sym("INTC", 5)) for bar(0) and wait for it to drop below 5.
        The proper syntax for these sma() series would be (assuming a length of 10 for each):

        sma( 10, sym("INTC,5") );
        sma( 10, sym("INTC,10") );

        To access the current bar 0 value of each series:

        sma( 10, sym("INTC,5") , 0 );
        sma( 10, sym("INTC,10") , 0 );



        At that point, I print something to the output window.

        I am doing this all from one EFS script that contains both series.
        But ticks will only come in at the interval of the chart that has that EFS loaded, correct?
        The EFS will execute main() when a trade update of the chart symbol occurs or any external symbol specified by a series declared within the EFS.

        So, how do I essentially get close ticks for multiple intervals, which could even be different from interval for the chart where the EFS runs??
        To access the most recently closed bar -1 value of each series:

        sma( 10, sym("INTC,5") , -1 );
        sma( 10, sym("INTC,10") , -1 );


        Do I have to run a separate EFS from a chart that corresponds to each interval, so I have a 5 minute chart that receives close ticks every 10 minutes and a 10 min. chart that receives ticks every 10 min.?
        No, you just need to specify a bar index parameter of the previous bars. Bar index of 0 in real time will refer to the currently developing bar. Bar index of -1 will refer to the most recently completed bar.

        And then when a condition occurs in either EFS, it sets a global var. with that condition, which the other EFS can monitor while it continues to process close ticks? So in effect, either EFS has access to the latest state of the other EFS through global vars. That is how they link together.

        Does that make sense? It sounds like it should work but seems rather complicated. I don't see an easier way.
        You could do it this way, but you could also do it within a single EFS. It's up to your personal preference really. I would try to use a single EFS personally.
        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
          Re: Also, what about using more than 7 series in one EFS?

          Hello crazytiger,

          Originally posted by crazytiger
          Say I have three timeframes (5, 10, and 15 min.) , 2 symbols, and 2 different indicators to monitor. That equals 12 separate series or 12 separate vars to maintain.

          But EFS2 only allows me to hold into max. 7 series in one EFS.

          Of course I could load multiple EFS scripts in the same chart to do this but I get back to the issue that requires receiving ticks for each interval separately so loading multiple EFS scripts into 1 chart is not what I want to do.

          How do I get around this? Just like the first post I made for this topic, do I have to load multiple charts with one EFS in each one to get past this limit, using global vars to communicate between the scripts?
          The limit is not for the total number of series but a total combination of external symbols and/or intervals accessed by a single EFS. With 2 external symbols, each combined with the same 3 external intervals, 5, 10 and 15 the total should be 7 including the main chart symbol. If you're running into the 7 symbol limit, please post a code example.

          Within a single EFS, you can not get around the 7 symbol limit. This limit per EFS is put in place to help minimize the overall data demands on the server farm.
          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


          • #6
            Re: My Understanding After Reading More Threads

            Hello crazytiger,

            Originally posted by crazytiger
            It looks like if I want to examine series for different indicators using the same symbol but different timeframes, and being able to process close bars as they come in for each interval,
            I will have to load a separate EFS into a separate chart for each interval.

            Only that way can I process bars when they arrive for each interval. Someone said they have done this and just minimized the windows for the lower timeframes if they just want to see a consolidation of the information on the bigger interval.

            But what if I don't want to reveal some of those charts to the user if they are using my EFS scripts? I don't want to reveal some of the timeframes to them, just a bigger timeframe which is annotated with stats from the other charts. Can I hide those charts somehow from the user?
            This will not be possible. In order for an EFS to be processing and accessing data, it must be applied to an active Advanced Chart. We do not have the ability to hide charts or run them in the background.
            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