Announcement

Collapse
No announcement yet.

Is there any way to prevent a EFS reload?

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

  • Is there any way to prevent a EFS reload?

    I just noticed that changing a function parameter resets all the globals, calls postMain and preMain. Is this correct?

    This is a big problem for me. I thought it would just change the values and call main with the updated values without reloading the entire chart. If it reloads the entire chart, then a lot of my chart annotations will be wrong because I am now processing the chart data as historical rather than in real-time.

    I have multiple charts interacting so I have to buffer all ticks up to the first currentbar state event for each chart. Then I have to go back and process all the data that has accumulated.

    Please tell me there is a built-in way to change a function parameter without processing the entire contents of the chart again.

  • #2
    crazytiger

    changing a function parameter resets all the globals, calls postMain and preMain. Is this correct?
    That is correct. When you apply the new parameters the efs is reloaded

    Please tell me there is a built-in way to change a function parameter without processing the entire contents of the chart again.
    I don't think there is a way to do that. If you need to preserve some calculated values you may have to save them to file and read them once the efs is reloading.
    Alex

    Comment


    • #3
      That is what I thought. That won't work for me. Sometimes, I just don't want the efs to reload at a particular moment. Say I am in the middle of a calculation. I don't want the efs to reload until that calculation is done.

      So I have to replace function parameters with my own way of editing parameters. That would be a useful feature to add in the future, that is to postpone or even bypass a reload when the parameters change.

      One more question - are all global variables (those set with setGlobalValue) reset when the EFS is reloaded? I don't think so. That wouldn't make sense. Only those declared inside main itself are reset. True?
      Last edited by crazytiger; 03-05-2007, 01:21 PM.

      Comment


      • #4
        crazytiger,

        One thing I do all the time is to initially assign a function parameter to a global variable and then use the global variable from then on. You could do the same, and just change the global variable using buttons or some other method.

        The global variables don't get reset when a chart is reloaded.

        Steve

        Comment


        • #5
          I have taken this a step further. Because I want complete control over when the function parameters are read into main() and how to process them, I have written my own custom edit dialog via a DLL call. That way I can choose to process the edit parameters immediately rahter than waiting for main() to be called. And I can choose to either reload the efs or by-pass it depending upon how I have configured the parameters.
          This offers way more flexibility and control but of course, it took me considerable time to create my dialog and hook it into the script.

          Comment

          Working...
          X