Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest help

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

    Backtest help

    My strategy is now ready to run. I would like to backtest it and would appreciate help with the following issues:

    1-How set session begin/end times for EURUSD that starts 5:30 pm Sunday and ends 5:30 pm Friday?

    2-How to specify commission? (Assume spread for EURUSD is 3 pips.)

    3-How set "Exit on Close"?

    4-One of my parameters is maximumLoss which has a default setting of -$150. When I enter that value it automatically changes to 1?

    5-I am currently connected to both TradeStation and Gain Capital. However, although time period is set to 1/1/09 to today and 30 minute interval, I can't get the chart or the backtest to recognize those settings. Historical data doesn't show and trades don't show on chart.

    #2
    1. You set a start time and an end time for a day at a time. You cannot set it from Sunday to Friday. If you have some more specific needs then you should instead set it to 24 hrs sessions and program time filtering as need be.

    2. You need to set this up in the Instrument Manager and be sure to select "Include commissions" when you run your strategy.

    3. When you run your strategy please set it to true.

    4. You need to change your code. Your code is stating minimum value for it is 1 in the Properties region for that parameter.

    5. Please only connect to the data provider you wish to try and retrieve data from first. GAIN does not provide you that amount of historical data.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Sim101 trades

      Thanks for all the help.

      In the Trades Tab in the Conrol Center, I have 7 trades. Although the Profit and Loss entries are red for losses and black for gains, all the amounts are zeros.

      How do I correct this?

      Comment


        #4
        You will need to look at the executions tab and correlate what your gains and losses actually are and try to correlate them back to what your trades are.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Backtest

          Thanks for your reply.

          I have just backtested my strategy. The performance report shows profit/loss on each trade as zero. However, it is obvious from the entry and exit prices that almost every trade is either plus or minus dollars.

          Since profitability is the only reason for trading, one would expect the performance to be expressed in dollars. How can I correct this?

          Comment


            #6
            Please ensure you are trading with enough quantity. In forex with prices being off to 4 decimal places, you can get trades that seemingly don't net anything.

            Please see this article: http://www.ninjatrader-support.com/H...ngFXStrategies
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              4 Questions

              My strategy is running simulated EURUSD 30 min.

              A trade description shows S.LRx [email protected],

              1-Is 0.1M $100,000? $10,000? $1,000?

              2-How can I change this? (I am using data from TradeStation. When I enter trades, I use 1 for 1 contract.)

              The last trade shows as 0930 June 4. There are no entries on the chart after 1100 am June 5.

              3-How can I bring the chart up to today’s date?

              In a backtest, all values show as zero. Quantity is set as 100,000.

              4-What am I not doing correctly?

              Comment


                #8
                Skat100,

                1. This is one regular lot of 100K

                2. In the backtest try entering 100000 to trade a full lot as in 1

                3. You would need to import a fresh set of historical data to backfill the chart to the point where you connect to realtime data.



                Most likely you would need to make sure all data is present before you backtest, and then enter the correct quantity to generated the trade staticstics related to the current lotsize you're looking for.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Strategy Implementation

                  Thanks for your reply.

                  Historical data is present back to 1/1/2009. Quantity is set to 100000. One problem is that the chart shows no data after 6/5. There is one burst of trade activity for a few days in May and on June 1. Otherwise, there are no trades showing. The performance chart shows all zeros.

                  How do I correct these problems?

                  Comment


                    #10
                    Please export the data and check that really all the needed historical data is present in your symbol, if not - you would then need to do a fresh data import. Have you backtested also with the SampleMACrossOver strategy?
                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Backtest Performance Report

                      I have followed all your suggestions.

                      After running the Backtest Performance Report, the profit / loss figures do not make sense.

                      For example, trade # 51 shows entry on a short sale at 1.3387 with an exit at 1.3350 and a profit of $0.04.

                      In pips the profit was 37. In dollars that would be $370.00, not $0.04.

                      How can I troubleshoot this?

                      Comment


                        #12
                        What quantity did you submit at? 100,000 quantity = 1 lot. Please show us exactly what you are seeing in the Strategy Analyzer with a screenshot for a run off of the SampleMACrossOver strategy. Thank you.
                        Josh P.NinjaTrader Customer Service

                        Comment


                          #13
                          Please provide a screenshot of the Strategy Analyzer showing the issue. Thank you.
                          Josh P.NinjaTrader Customer Service

                          Comment


                            #14
                            Some new problems

                            1-When I started today, I opened a EURUSD chart. Data from 2:48 am to 11:46 am is missing. I re-imported the data but the data is still missing.

                            2-I tried to add my stategy to the chart but "Strategies" on the tool bar is greyed out. Control S does not work.

                            I have been trying for several weeks now to translate a TradeStation strategy to Ninja. This has been an agonizing experience. I would like to make a suggestion. All the controls needed to develop and operate a strategy are in different places. Why not create a dashboard which collects appropriate collections of instructions for each task? This would not be a big programming job. It would simply be a layout job plus links.

                            Thanks for your help. I do appreciate the rapid responses.

                            Comment


                              #15
                              skat100, just to clarify for the TradeStation connection this is expected - when you're not connected 24 hrs live collecting data, you would need to reload this historical data using the TS Data Download strategy. Please export the data from the EURUSD symbol and check if it's present as you expect. If not delete the data and export a fresh generated txt file from TradeStation.

                              Do you have the ChartTrader panel enabled by any chance? This will prevent the strategies button from being available.

                              Thanks for the suggestions!
                              BertrandNinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by TradeSaber, Today, 07:18 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post TradeSaber  
                              Started by PaulMohn, Today, 05:00 AM
                              0 responses
                              9 views
                              0 likes
                              Last Post PaulMohn  
                              Started by ZenCortexAuCost, Today, 04:24 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post ZenCortexAuCost  
                              Started by ZenCortexAuCost, Today, 04:22 AM
                              0 responses
                              3 views
                              0 likes
                              Last Post ZenCortexAuCost  
                              Started by SantoshXX, Today, 03:09 AM
                              0 responses
                              17 views
                              0 likes
                              Last Post SantoshXX  
                              Working...
                              X