Announcement

Collapse
No announcement yet.

Automated Backtest

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

  • Automated Backtest

    Hi,

    Just to check that I am not going over old ground, I have a script which I am looking to optimise, ultimately what I need to do is the following:


    1. Declare two variables, VPTMax (Profit Target Max)
    VSLMax (Stop Loss Max)

    2. Set Default Target and Stop to mins (ie, 5 and 5)

    3. Run Script

    4. Append following data to txt file, Default PT, Default SL, pCntr, tCntr

    5. Increment Default Target

    6. If Default target = VPTMax, then increment Default stop and set default target back to 5 again.

    7. Save and reload script

    As you can imagine, if I do this with the respective mins and max of 5 and 40, this will automatically give me a report on some 1200 or so combinations.

    The question is, has anybody done this before ?

    Thanks

    Roger

  • #2
    Also, although I think I can see a way of doing this, where do we declare the variables so that when we reloadEFS they stay updated.

    Thanks

    Roger

    Comment


    • #3
      Hello Roger,

      You could use a text file to store the current values for the parameters and have the EFS read those at the start of the test. Then have a routine at the end of the test that increments the parameters by some fixed amount and rewrite the new parameters to the text file to be used for the next test.

      Another thing you could do instead of using a text file to store the parameter values between tests would be the setGlobalValue()/getGlobalValue() functions.
      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


      • #4
        Thanks Jason, I am nearly there, we have it all working, and it appears to increment our Target correctly, the trouble is, reloadEFS() doesn't seem to do anything.

        Obviously we want to to automatically reload when its finished calculating its past trades and move on to re-calculating under the incremented parameters.

        We declare the Stop and Target variables before pre-main, in the hope that when they are incremented at the end of the script, the will stay that way when the EFS is reloaded.

        So I guess I have two questions, should I use Global Values instead or should this work OK, and secondly, why isn't reloadEFS working , its the second last command before return array at the end of the script.

        Thanks

        Comment


        • #5
          Hi Jason,

          Ignore the last comment, its all working now, reloading and recalculating as planned.

          I wish I had a supercomputer now, it would probably take me a little less longer than an entire weekend then ;-)

          Thanks again

          Roger

          Comment

          Working...
          X