Announcement

Collapse
No announcement yet.

global variables

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

  • global variables

    I hv a strategy that depends on 2 charts:
    i) 10min 24hr
    ii) 10min 9:30-16:15

    I need to communicate them by global variables since EFS2 support calculating different symbol/interval but NOT different timeframe.

    The problem is that when I reload the charts, the historical values of the global variables are gone and only the latest value of them are available. So the charts are not showing the way it should be if they are run realtime.

    Is there anyway to solve this?

  • #2
    Hello Richard,

    One possible approach to this is to create a series within each study by calling the other study with efsExternal(). The data that you are passing to the setGlobal... functions would need to be returned by main() instead.
    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
      If the EFS is a simple MA-crossover system, and I load it on the 2 10min charts (one RTH and one 24hr)... how can the system know which data series I want since both of the charts are showing the same symbol in the same time-frame (but different time template)?

      myVar = efsExternal( "myCustomEFS.efs", sym( "IBM,10" ), 20, 5 );

      Comment


      • #4
        Hello Richard,

        On second thought, that will not work as efsExternal() is going to be operating in the time template settings from the chart that is it running on. You may have to use the File Object and write your data to text files that include time stamps. You'll then need to write a routine that parses through the text files to find the data with the time stamp of the bar that your EFS is processing on.

        Another alternative would be to run both studies on a 24-hr time template and manually code the moving average study that has the time restriction. You would maintain the price data for the calculation in an array and not update the array unless the bar's time stamp is within your specified time range. This would be the route I would take as the moving average calculations are simpler to code than the synchronization routine through File I/O.
        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