Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer Date Backtest Range Changes

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

    Strategy Analyzer Date Backtest Range Changes

    This was an issue that was previously posted (http://www.ninjatrader.com/support/f...ad.php?t=37527)

    When I try to run backtests through the strategy analyzer (even with the premade samples) it returns no results and gets stuck on:

    start date 4/13/2006

    end date 4/13/2006

    no matter what start/end dates I select.

    Now when I open a separate chart and run it through the right click menu it works fine.

    It also seems to completely ignore stop loss or profit targets.

    The last question I have is:

    if I am in the strategies menu from right clicking on a separate chart and under order properties I select account size of X and I select by account size under "set order quantity" shouldn't it use the maximum number of contracts it can buy based off the current account balance?

    Thank you.

    #2
    Hello, what data provider / broker would you be using here? What timeframe are you testing on in the Strategy Analyzer?

    How are the stop loss and profit targets coded in? Please note that for a percentage based target for example 0.01 would equal 1 percent.

    For the order qty question, it would also be important to check which margin you've setup under Tools > Instrument Manager for the product you're trading.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hello, what data provider / broker would you be using here? What timeframe are you testing on in the Strategy Analyzer?

      How are the stop loss and profit targets coded in? Please note that for a percentage based target for example 0.01 would equal 1 percent.

      For the order qty question, it would also be important to check which margin you've setup under Tools > Instrument Manager for the product you're trading.
      BertrandNinjaTrader Customer Service

      Comment


        #4
        Kinetick free EOD

        Time-frame: Daily

        stop loss/profit: in the edit strategy window I click add, select stop loss then:

        from entry signal: "Long Entry" #this is the name of my long entry

        mode: percent #doesn't seem to matter what I select with this

        value: .01 #clearly messes something up because without it I have a max drawdown of ~30% and with it the max drawdown is more than 70%

        simulated: true #or false, has no effect

        The margin box is greyed out.

        Comment


          #5
          The simulated option would not be available in backtesting, it would play a part only if the strategy was traded realtime (is the stoploss submitted so other could see it, or would it be locally held?).

          Would you mind attaching the strategy here or sending it to support at ninjatrader dot com so we could give a quick run for you?

          Which instrument(s) are you trading here? Stocks?
          BertrandNinjaTrader Customer Service

          Comment


            #6
            at this point I don't really care if the stop is held local/submitted. I'm trying to learn the interface with something basic.

            The strategy is attached as a .txt let me know if you need a different file type.

            Instruments:
            This morning I tried everything.
            Ideally I want to be able to back test on indexes in addition to stock/futures.

            also I'm having trouble downloading historical daily (sometimes) and intraday (always) regardless of the data feed. I tried to use ToS data feed through TD and that gave me a couple of different errors. When I use continuous contracts it doesn't do anything.

            Is there any easy way to convert a csv file to your format? I have some data but the year is in the wrong place and there is an extra data field.

            edit: also when I try to import data why does it force me to use "stock" instead of futures (so I could set a multiplier) or index, even when the exchange is set to globex?
            Attached Files
            Last edited by stuck; 01-25-2012, 10:06 AM.

            Comment


              #7
              Stuck

              I am happy to assist you on behalf of Bertrand.

              As far as your strategy is concerned, I can get it to work. Please keep in mind testing on a daily time frame may only enter very few trades. Please increase the date ranges you are using and test again.

              I'm having trouble downloading historical daily (sometimes) and intraday (always) regardless of the data feed. I tried to use ToS data feed through TD and that gave me a couple of different errors. When I use continuous contracts it doesn't do anything.
              ToS is not supported by NinjaTrader at this time. You should only be able to get equities data from TD Ameritrade at this point.

              Is there any easy way to convert a csv file to your format? I have some data but the year is in the wrong place and there is an extra data field.
              You can import CSV file data into NinjaTrader using Tools > Historical Data Manager > Import. You can set the timezone formatting here. If the time zone is not formatted to one of the types available, you would need to run some script on your end to format it appropriately, or do it manually.

              Here is an example of NT format : 20120118 140000;1.2803;100000

              edit: also when I try to import data why does it force me to use "stock" instead of futures (so I could set a multiplier) or index, even when the exchange is set to globex?
              Are you attempting to import using the Historical Data Manager?

              Please let me know if I may assist further.
              Adam P.NinjaTrader Customer Service

              Comment


                #8
                If this is relevant I'm using the 64 bit version of the latest version of NT. I have tried everything that I have listed on this thread in the 32 bit version.

                I'm using a large date range (50yrs) and it still does not work.

                I use historical data manager to import the data. That set is formatted correctly. Another problem is when I try to edit data set information through instrument manager I can't change instrument type, margin value, point value: these are greyed out. When I try to edit other settings that I can access and hit ok it tells me to select an extra exchange besides default. When I do this and click ok I see the ok button do the click response but nothing happens. The window will only close if I hit cancel.

                After I do this sometimes it can't get EOD data from kinetick. I then have to restart NT.

                NT also refuses to load any bars for a chart when I select the uploaded data set.

                As far as NT supporting other time formats, it doesn't. It only supports one format but it will adjust timestamps of that format for different time zones as selected. This seems like an obtuse design when supporting multiple time formats is a pretty standard feature and easily supported by most languages...

                I have some experience with debugging and I know that often it is a user error. I'm trying to find what I'm doing wrong but I have spent 6 hours on this today and can't figure it out. I looked at the help guide and nothing from that has helped.

                I have also restarted my computer and re installed NT if that is helpful.

                As for the backtest all I can tell you is with the exact same code that I gave you it refuses to run on my computer.

                Comment


                  #9
                  Stuck,

                  I use historical data manager to import the data. That set is formatted correctly. Another problem is when I try to edit data set information through instrument manager I can't change, instrument type, margin value, point value: these are greyed out. When I try to edit other settings that I can access and hit ok it tells me to select an extra exchange besides default. When I do this and click ok I see the ok button do the click response but nothing happens. The window will only close if I hit cancel.
                  You wont be able to modify instrument type as well as the other fields you mentioned for existing instruments, I would suggest creating a new instrument instead.

                  Your going to have to convert the file into NinjaTrader format. Basically you will need to set the file name to something like this : $EURUSD.Last.txt. You can alternatively use Metastock format.

                  As far as NT supporting other time formats, it doesn't. It only supports one format but it will adjust timestamps of that format for different time zones as selected. This seems like an obtuse design when supporting multiple time formats is a pretty standard feature and easily supported by most languages...
                  Apologies, I mean time-zones.

                  I have some experience with debugging and I know that often it is a user error. I'm trying to find what I'm doing wrong but I have spent 6 hours on this today and can't figure it out. I looked at the help guide and nothing from that has helped.
                  Your code works on my end. What are your other settings for the strategy when you run it in the wizard? Could you perhaps take a screen shot?
                  Adam P.NinjaTrader Customer Service

                  Comment


                    #10
                    how do I create a new instrument that links back to a local file for the data?

                    ok I got it to run the back test in the strategy analyzer but it is stuck with 1 contract.

                    I set the account size to 100000, margin value is 0 and point value is 1 for the item I used to backtest.

                    There is also a problem with the data from 1970 to the end of 1977, 6/21/1978 to 7/26/1983 (there are a few random bars in between with open != close. The open and close are always the same. This is through kinetick EOD.

                    Also the stop loss is still failing. What was the max loss on a trade when you ran it?

                    Comment


                      #11
                      stuck,

                      how do I create a new instrument that links back to a local file for the data?
                      The data you import should link to the instrument in the name : $EURUSD.Last.txt

                      So this file would like to the Last data for $EURUSD instrument.

                      ok I got it to run the back test in the strategy analyzer but it is stuck with 1 contract.
                      When you do a backtest, in the "Order Properties" section in the Strategy properties, ensure that "Default quantity" is set appropriately.

                      There is also a problem with the data from 1970 to the end of 1977, 6/21/1978 to 7/26/1983 (there are a few random bars in between with open != close. The open and close are always the same. This is through kinetick EOD.
                      This can be expected if there are after hours trading.

                      Also the stop loss is still failing. What was the max loss on a trade when you ran it?
                      1 percent of 1.4443 for example is approximately 0.0144. This would be the amount the price is allowed to move in the opposite direction before a stop loss is triggered. Its currently performing as expected with your strategy on my end.

                      Please let me know if I may assist further.
                      Last edited by NinjaTrader_AdamP; 01-25-2012, 04:10 PM.
                      Adam P.NinjaTrader Customer Service

                      Comment


                        #12
                        What I'm saying is that isn't what is happening.

                        I upload the file, it says everything worked.
                        (file name is test.Last.txt if the $ sign is in front I get an error)

                        I go to edit in historical data manager to make sure the data is there, it is.

                        then file->new->chart select test
                        make sure times match (day data to days)

                        then I get error on loading chart data for "test Default": failed to retrieve data from (any of the data services available)

                        then I go to tools-> instrument manager
                        select test from the list click edit
                        try to edit any of the data and hit "ok"
                        ERROR you must assign an exchange in addition to the 'Default' exchange
                        select one at random because the instrument ISN'T listed.
                        click ok
                        the ok button responds but nothing happens. The instrument editor window remains open.

                        now I X that out because it is useless.
                        back on the instrument manager window
                        click new
                        ???????????????????? (don't know what to do)
                        enter test.Last.txt as master instrument
                        select default
                        try to hit ok
                        WARNING YOU MUST SET A LEAST ONE 'SYMBOL MAP' VALUE
                        ??? It is a local file... not on a website
                        C+P the directory of the file into External
                        try to load, same error.

                        entries per direction is set to more than one (it is 100000 right now to make sure)
                        still uses only 1 contract
                        should have adequate capital defined if the calculation for number of contracts =capital/facevalueofcontract

                        "This can be expected if there are after hours trading."
                        Frankly that doesn't make sense unless there is a bug in the data. I have data that doesn't do that and includes AH which is part of the reason I would like to be able to import local data sets.

                        Stop loss was fixed after copying the original, deleting that strategy, and pasting into a new strategy.

                        Comment


                          #13
                          stuck,

                          Thanks for your note.

                          Could you possibly post this data?

                          What instrument are you attempting to load back to 1970?

                          A symbol map needs to be set, you can just set the symbol name in the "Kinetick" section in the "Misc" tab. After this you should be able to save the new instrument.

                          As far as your strategy running with only 1 order, please check the "Order Properties" section in the Strategy properties, ensure that "Default quantity" is set to the proper number.

                          I look forward to helping you resolve your issue.
                          Adam P.NinjaTrader Customer Service

                          Comment


                            #14
                            I would prefer not to post it on the forum but I can probably PM it.
                            Maybe we can arrange something...

                            INDU

                            The problem with default order quantity is that I want it to take a full clip all the time. There isn't a setting for this as far as I know. It would also be useful to have functions so you could scale into positions properly.

                            Comment


                              #15
                              stuck,

                              All this is possible in NinjaScript, it just takes some extra coding steps.

                              Here is a link to reference samples for advanced coding of strategies : http://www.ninjatrader.com/support/f...splay.php?f=30

                              You can send an email to Support at NinjaTrader dot com with "ATTN : Adam Ticket : 598502" in the message body or subject. We can work together privately this way.

                              Please let me know if I may assist further.
                              Adam P.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by aa731, Today, 02:54 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post aa731
                              by aa731
                               
                              Started by thanajo, 05-04-2021, 02:11 AM
                              3 responses
                              470 views
                              0 likes
                              Last Post tradingnasdaqprueba  
                              Started by Christopher_R, Today, 12:29 AM
                              0 responses
                              10 views
                              0 likes
                              Last Post Christopher_R  
                              Started by sidlercom80, 10-28-2023, 08:49 AM
                              166 responses
                              2,237 views
                              0 likes
                              Last Post sidlercom80  
                              Started by thread, Yesterday, 11:58 PM
                              0 responses
                              5 views
                              0 likes
                              Last Post thread
                              by thread
                               
                              Working...
                              X