Announcement

Collapse
No announcement yet.

backtesting

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

  • backtesting

    Hi Alex
    In calculating of return backtester take into consideration the opening price of the bar. How do I change that to a close or to actual value when the signal is generated.
    Thanks

  • #2
    osmar92
    You would use Strategy.CLOSE and Strategy.THISBAR to use the Close of the current bar
    Alex

    Comment


    • #3
      Still

      I had .MARKET changed to .CLOSE backtester still calculates open price

      Comment


      • #4
        osmar92
        Post your code or attach the efs so someone can give a look at it
        Alex

        Comment


        • #5
          efs

          posted efs files
          Attached Files

          Comment


          • #6
            osmar92
            In lines 21 and 28 you still have Strategy.MARKET and not Strategy.CLOSE as I suggested in my prior reply. This is why it is using the Open and not the Close as the entry price.
            Alex

            Comment


            • #7
              EFS

              Alex
              I know i want you to change to .Close and take a look if backtester changed calculations. I dont see it changed. Buy and Sell price are the same if you change to close from market

              Comment


              • #8
                osmar92
                I ran a back test on ES M5 daily before and after replacing Strategy.MARKET with Strategy.CLOSE and the entry prices shown in the Strategy Analyzer Report correctly changed from Open to Close as you can see in the two images below
                Alex



                Comment


                • #9
                  EFS

                  Alex
                  Sorry, you are absolutely right. What other choices besides .close and .market. Actually I need presice price when my condition met to execute strategy, it is not close or open. I takes open price when .market is used.
                  Appreciate it

                  Comment


                  • #10
                    osmar92
                    You could use Strategy.LIMIT. If you run a Search in this Bulletin Board using Strategy.LIMIT as the Keyword you will find several examples on how to use it
                    Alex

                    Comment


                    • #11
                      efs

                      Alex
                      I changed .MArket to .LIMIT and back-tester showes only Zero's. Where do I plug in current price as limit in upon condition met
                      THanks
                      P.S. I search function but did not find what I need

                      Comment


                      • #12
                        osmar92
                        You can find that information and examples in this article in the EFS KnowledgeBase and in the Guide to Developing eSignal Strategies also in the KB.
                        Alex

                        Comment

                        Working...
                        X