Announcement

Collapse
No announcement yet.

BackTesting: How to eliminate certain dates?

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

  • BackTesting: How to eliminate certain dates?

    Thanks, thanks, thanks for EFS and BackTesting! WOW!! But, there's a "but": I'm having good results with my backtests on E-minis; am able to set start/end times for day-trading activity, etc., and have built some rather complex systems. However, the system insists upon trading on Sundays, Thanksgiving Day, etc. These days tend to have strange patterns that throw off the results, and I don't wish to "trade" them. Since there doesn't seem to be a multi-dimentional array capability (much less any kind of database file lookup!) available in JavaScript, how can I set up a list or table to test against and thus block out the days I don't want the system to backtest? Hard-coding a list of several hundred dates, or a dozen do-loops, to scan against for each bar seems VERY stone-age, error-prone and SLOW! While getDay() might work to eliminate Sundays, I can't find a way to make it work with anything but the System Clock; i.e., it won't return day-of-the-week with price data. And that would still leave the other odd dog-and-cat days I want eliminated. Have I once again missed the obvious solution? Suggestions, please!

  • #2
    Solution...

    I just created an exmple of this for another user. I guess the holiday is really messing with people and the backtests.

    Visit this thread and download my code example. It is pretty clear. You can set as many dates as you like into the ARRAY and the system checks for these dates, then sets a logical variable (allowing trades or not)

    Help with date coding

    Glad you are making such progress.
    Brad Matheny
    eSignal Solution Provider since 2000

    Comment


    • #3
      RE: Reply to post 'BackTesting: How to eliminate certain dates?'

      THANKS for the super-fast reply, Brad! I read this solution before
      writing you, but was too dim to make the multi-date connection -- must
      be tough to be an eagle working with us turkeys... Keep up the good
      work!
      Irv Prail, Recovering(Sorta) Code Pusher

      -----Original Message-----
      From: [email protected] [mailto:[email protected]]
      Sent: Wednesday, December 03, 2003 10:50 PM
      To: [email protected]
      Subject: Reply to post 'BackTesting: How to eliminate certain dates?'

      Hello IrvPrail,

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      Comment


      • #4
        folks...

        here is an example of how to EXCLUDE dates and DAYS.

        This code allows for both DATE exclusion (like 11/19) and DAYS to exclude (like Sunday and Tuesday).

        Hope this helps.

        B
        Attached Files
        Brad Matheny
        eSignal Solution Provider since 2000

        Comment


        • #5
          Here it is as a function..

          This is the same code developed as a function (makes it easier - I guess).

          B
          Attached Files
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment

          Working...
          X