Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

backtesting issues

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

    backtesting issues

    Sorry to trouble you guys again. I have weird backtesting issues.
    First question:
    After I debug, I found that GetAccountValue(AccountItem.CashValue) returns 0 for me. I used AMP's demo account to log into CQG. After I launch NT7, I click Accounts, I see that I have two accounts there. (Not sure why). First one is Sim101, which shows cash value of 100000, and second starts with DEMOAMP1220! something, and account value is 0.
    In backtesting, I have a function that tries to determine how many contracts to trade based on account cash value, and since GetAccountValue(AccountItem.CashValue) returns 0, my function returns 0 as the number of contracts, so my strategy is unable to run. This is quite weird. Can anyone please help me?

    The second question:
    When I try to backtest, I use the 3 minute chart, and I can set test from 1/1/2012 to 3/5/2012. However, I am not sure if CQG really has that much date for the 3 minute chart. How would NT7 handle this case?

    The third question:
    When I start live trading, I would want to apply my strategy to multiple charts. But if at the same time all of them try to entry a trade, I want to restrict the total number. Let's say, I have 100 instruments applied, and if at the same time all of them find an entry, I only want the first five. How do I do that? I am not sure if the following code is applied to only that specific instrument, or it is a glabal variable in NT7 that all strategys respect?

    EntriesPerDirection = 5;
    EntryHandling = EntryHandling.AllEntries;

    #2
    Zehua,

    Thanks for your note,

    First question:
    After I debug, I found that GetAccountValue(AccountItem.CashValue) returns 0 for me. I used AMP's demo account to log into CQG. After I launch NT7, I click Accounts, I see that I have two accounts there. (Not sure why). First one is Sim101, which shows cash value of 100000, and second starts with DEMOAMP1220! something, and account value is 0.
    In backtesting, I have a function that tries to determine how many contracts to trade based on account cash value, and since GetAccountValue(AccountItem.CashValue) returns 0, my function returns 0 as the number of contracts, so my strategy is unable to run. This is quite weird. Can anyone please help me?
    The SIM101 account is an account local to your PC. You can set how much cash is available in Tools > Options > Simulator.

    The DEMOAMP1220! account is a AMP demo account that would need to be set to have cash in it through AMP. You are probably attaching your strategy to a chart specifying this account as the one to trade on, and since AMP is reporting 0 cash this explains the issue.

    The second question:
    When I try to backtest, I use the 3 minute chart, and I can set test from 1/1/2012 to 3/5/2012. However, I am not sure if CQG really has that much date for the 3 minute chart. How would NT7 handle this case?
    CQG should have approximately 6 months of data if I am correct so you should be fine. It may be different for demo accounts however. If data isn't available the strategy analyzer would skip these dates.

    The third question:
    When I start live trading, I would want to apply my strategy to multiple charts. But if at the same time all of them try to entry a trade, I want to restrict the total number. Let's say, I have 100 instruments applied, and if at the same time all of them find an entry, I only want the first five. How do I do that? I am not sure if the following code is applied to only that specific instrument, or it is a glabal variable in NT7 that all strategys respect?
    Unfortunately this isn't possible in supported way, but there are people in this forum and other that have made some work around's. I would suggest doing some research on the topic. Unfortunately I don't have the thread links off the top of my head.

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

    Comment


      #3
      Originally posted by NinjaTrader_AdamP View Post
      Zehua,

      Thanks for your note,



      The SIM101 account is an account local to your PC. You can set how much cash is available in Tools > Options > Simulator.

      The DEMOAMP1220! account is a AMP demo account that would need to be set to have cash in it through AMP. You are probably attaching your strategy to a chart specifying this account as the one to trade on, and since AMP is reporting 0 cash this explains the issue.



      CQG should have approximately 6 months of data if I am correct so you should be fine. It may be different for demo accounts however. If data isn't available the strategy analyzer would skip these dates.



      Unfortunately this isn't possible in supported way, but there are people in this forum and other that have made some work around's. I would suggest doing some research on the topic. Unfortunately I don't have the thread links off the top of my head.

      Please let me know if I may assist further.
      Thanks Adam.
      For the first issue, I clicked New-Strategy Analyzer, and then right clicked ES 03-12, and then selected my own strategy. I cannot assign any account to this.
      Are you suggesting that I open a chart instead, and then backtest the strategy from there? In that way, will I be able to backtest Sim101 instead of the other account?
      I will also try to ask AMP futures to adjust their demo account value for me.

      Comment


        #4
        zehua,

        Please see the attached screen shot.

        You should be able to adjust the account there.
        Attached Files
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_AdamP View Post
          zehua,

          Please see the attached screen shot.

          You should be able to adjust the account there.
          I still can't figure out.
          I am trying to do backtesting, not real time testing yet. From your screenshot, I think you opened a chart and then attached the strategy to the chart. Yes I can certainly select the account. But how do I do backtesting on Sim101 instead of the other account?

          What's more confusing to me is that when I launch strategy analyzer, and try to do backtesting, it is running on the AMP demo account instead of Sim101, but there is no way to know that until I attach the debugger. I think this is really unprofessional. Why is NT7 designed like this?
          Last edited by zehua; 03-06-2012, 09:27 PM.

          Comment


            #6
            Originally posted by NinjaTrader_AdamP View Post
            zehua,

            Please see the attached screen shot.

            You should be able to adjust the account there.
            OK. Maybe I didn't ask the question in the right way.
            Let's put it this way. Let's forget the AMP demo account. Just assume I am a newbie who knows nothing about backtesting. Now could you tell me how do I get a reliable data source for 3 minute charts and other intraday charts for futures so I can do backtesting?

            Comment


              #7
              Zehua,

              Kinetick offers 120 days of tick data, 2 years of minute data, and 10 years or more of daily data. A lot of people use this data feed for supplementing the one provided by their broker/data-provider.



              For live trading through the strategies tab or by attaching a strategy to a chart, you can change the account to whatever account you want a strategy to trade on in that field I showed you. If you are a live license user, you can go to File > Check Global Simulation Mode to disable live trading and only use Sim101 account as well.

              Backtesting is different in that it backtests automatically to the "Backtest" account. This account assumes unlimited money, but will return 0 from the GetAccountValue() call. If you want to backtest using this as a variable, I suggest you make some kind of flag where you can toggle between using the account value from a manually set variable, or using the account value from a live account for live trading.

              Please see the screen shot for the strategies tab version of strategies properties.

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

              Comment


                #8
                Originally posted by NinjaTrader_AdamP View Post

                Backtesting is different in that it backtests automatically to the "Backtest" account. This account assumes unlimited money, but will return 0 from the GetAccountValue() call. .
                OK. That is all I need to know. Why don't you guys tell me this yesterday.
                Last edited by zehua; 03-07-2012, 10:49 AM.

                Comment


                  #9
                  zehua,

                  Apologies, I was under impression you were testing on Sim account which is via a chart or in Strategies tab. Looking again I see you mentioned backtesting.

                  I noticed you had another inquiry before you edited your post. Do you still require assistance on that?
                  Adam P.NinjaTrader Customer Service

                  Comment


                    #10
                    Originally posted by NinjaTrader_AdamP View Post
                    zehua,

                    Apologies, I was under impression you were testing on Sim account which is via a chart or in Strategies tab. Looking again I see you mentioned backtesting.

                    I noticed you had another inquiry before you edited your post. Do you still require assistance on that?
                    No thanks. I found that was my own problem.

                    Comment


                      #11
                      zehua,

                      Please don't hesitate to contact us should you require additional assistance.

                      We can also be reached directly at support (at) ninjatrader (dot) com.
                      Adam P.NinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by elirion, Today, 01:36 AM
                      0 responses
                      3 views
                      0 likes
                      Last Post elirion
                      by elirion
                       
                      Started by gentlebenthebear, Today, 01:30 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post gentlebenthebear  
                      Started by samish18, Yesterday, 08:31 AM
                      2 responses
                      9 views
                      0 likes
                      Last Post elirion
                      by elirion
                       
                      Started by Mestor, 03-10-2023, 01:50 AM
                      16 responses
                      391 views
                      0 likes
                      Last Post z.franck  
                      Started by rtwave, 04-12-2024, 09:30 AM
                      4 responses
                      34 views
                      0 likes
                      Last Post rtwave
                      by rtwave
                       
                      Working...
                      X