Announcement

Collapse
No announcement yet.

Backtesting

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

  • Backtesting

    I tested the supplied backtesting file which comes with eSignal and it works fine. I moved an efs file I wrote which works fine into the backtesting folder containing the supplied files in esignal/formulas/backtesting. When I load the efs file into the chart, go to tools and select the file to run the backtest, only 2 of the 3 supplied files show in the dialog box and my file does not show up for selection. How do I get my file to show up?

    Best Regards,

    Alan

  • #2
    Alan
    If you right click the chart and select Formulas->BackTesting is your efs listed in the context menu?
    Alex

    Comment


    • #3
      Backtesting

      No. In the dialog box in the 'formula" slot, only two of the supplied efs files show up. Mine does not.

      Best Regards,

      Alan

      Comment


      • #4
        Alan
        Using Windows Explorer go to that folder and rename the file adding .efs to it
        Alex

        Comment


        • #5
          Backtesting

          Renamed the file to a totaly new name. Added .efs and reran. The file shows up as xxx.efs.efs I then added the file to the chart from formulas/backtesting. Rt clicked the chart, tools, backtesting and the dialogbox stil shows only two files.

          Best Regards,

          alan

          Comment


          • #6
            Alan
            Which dialog box are you referring to? Perhaps an image may help in better understanding the issue.
            Alex

            Comment


            • #7
              Backtesting

              Attached is a file containing 2 screen prints. The fist is a 40 tick chart after loading the supplied backtesting file btEMA. Numerous signals are generated. The 2nd image is after rt clicking the chart/tools/backtesting and attempting to select the file name prior to clicking test. Note only two files show in the pull down menu. The file name btEMA does not show even though it was selected and loaded from the backtesting folder.

              Best Regards,

              Alan
              Attached Files

              Comment


              • #8
                Alan
                The name does not appear in the dropdown list only because you have yet to use your efs. Click the button with three dots that is right next to the dropdown list and then select your efs from the list in the dialog box.
                Once you do that your efs will also be listed in the dropdown list
                Alex

                Comment


                • #9
                  Thank you. The custom efs backtesting is now running.

                  The attached file shows the strategy code for a long only process. There are no errors and the results are what I expect. The bottom blue bars on the right reflect the correct buy ( when the blue begins ) and the cover of the long position ( when the blue stops ). The left shows the results of the backtesting. There is only 1 position in the results but 20 blue bars in the right chart for one day. Is there a backtesting code error?

                  Your assistance is greatly appreciated.

                  Best Regards,

                  Alan
                  Attached Files

                  Comment


                  • #10
                    Alan
                    In general you may want to paint the bars (or background) based on the strategy rather than on the conditions (especially if you are backtesting). So for example instead of
                    if(MA6 >= MA4) {
                    setBarBgColor(Color.blue);
                    } else if(MA5 <= MA3) {
                    setBarBgColor(Color.white);
                    }

                    you could write
                    if(Strategy.isLong()){
                    setBarBgColor(Color.blue);
                    }

                    This way you can see if there is an error in the strategy logic as in your case. The error is in the strategy condition
                    } else if(MA5 <= MA3) {
                    if(!Strategy.isLong()) {

                    which will return true only if the strategy is NOT long.
                    Should instead be
                    } else if(MA5 <= MA3) {
                    if(Strategy.isLong()) {

                    This will return true if the strategy IS long
                    Alex

                    Comment


                    • #11
                      Backtesting

                      Thank you for the suggestions. I implemented all of them and the backtesting is working well.

                      Best Regards,

                      Alan

                      Comment

                      Working...
                      X