Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Moving from backtest to the next step

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

    Moving from backtest to the next step

    Hi,

    I have been developing a daily strategy in NT7, and I have reached a decent confidence in it through backtesting. Right now it is backtested/optimized on a basket of instruments (S&P500). I want to try enabling it in the Sim101 account for historical replay testing, and then use it for manual buy/sell signals on real-time daily data (before finally, full automation). I figured out how to add the strategy on a per-ticker basis in the strategy tab, but I haven't been able to get the strategy to make any trades for the Sim101 account.

    Anything obvious I might have missed?

    #2
    Hello Lavafang,

    Thank you for your post.

    On the Strategies tab of the Control Center, is the strategy enabled? And is it Yellow, White or Green in the Strategy column?

    Comment


      #3
      I have tried enabling (so it turns green), but I see no historical trades placed.

      Comment


        #4
        Hello Lavafang,

        Thank you for your response.

        Please right click in the chart > select Strategy Performance > Historical (not Real-Time or Real-Time and Historical). Do you see the trades here?

        Comment


          #5
          Yes, I do see the trades under the historical strategy performance. But is there some way I can run this on the daily data to get buy/sell indicators at (or ideally, a few minutes before) the session closes?

          Comment


            #6
            Lavafang, which broker or datafeed are you using here with NT7 to do your testing? To simulate executions on the NT internal Sim101 account you would need to have access to realtime data.
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Hey Bertrand. I am running with Kinteck paid data. The issue may be that I only trigger buy signals a handful of times a year. I'm not sure exactly how this strategy will work in realtime. My understanding is that UpdateOnBarClose will be forced false, meaning that my condition can be met within a bar, and I would open a position more or less immediately in this case. Is that right?

              Maybe I should leave the strategy running for a few weeks while the market is open. I have been doing all the writing/testing while the market is closed, and I was wondering if I could see a buy/sell trigger over my collection of instruments, but after the market was closed (on historic data). This is a fairly slow strategy, so I'm not overly concerned with the precise order execution time or anything like that.

              Comment


                #8
                Hello Lavafang,

                Thank you for your response.

                In real-time testing using CaculateOnBarClose = False the calculations will be intra-bar, but all executions regardless of CalculateOnBarClose will occur intra-bar in real-time testing.

                You may wish to run the strategy on the Sim101 in real-time or even run Market Replay. For information on Market Replay please visit the following link: http://www.ninjatrader.com/support/h...ket_replay.htm

                Please let me know if I may be of further assistance.

                Comment


                  #9
                  It's been a few days. I've been running on Sim101 with real-time. I see my strategy has entered into a position (72L). It gives the avg price under the Strategies tab, but I don't see anything for Unrealized P&L, and I can't find any other info on the trade under executions, positions, accounts, or account performance. Any idea what's going on?

                  Comment


                    #10
                    Hello Lavafang,

                    Thank you for your response.

                    Are you running ATM Strategies in your NinjaScript strategy?
                    Information will not be reported in the Account performance tab until the trade is closed.
                    If you right click on the strategy in the Strategies tab and select Strategy Performance > Real-Time (not Real-time and Historical), do you see any trades?

                    Comment


                      #11
                      Sorry I haven't responded for a few days.

                      I am not using ATM strategies.

                      If P&L is not reported until the position is closed, why is there an unrealized profit column?

                      I am running this on the S&P500 (so it's actually 500 separately running strategies).

                      When enabling the strategies, I get a few errors on the few instruments that make trades saying "There is no market data available to drive the simulation engine."

                      What I actually see under the orders tab for that instrument is: a filled buy order, "working" stop loss and profit targets submitted at the same time as the buy, and rejected stop loss and profit targets submitted at the time of the strategy enable. I think this has something to do with the synchronize account option, but I'm a little confused. Why is NT attempting to place the orders again, if they are already in working state?

                      I am wondering if this is happening because I am enabling the strategy outside of normal market hours?

                      Comment


                        #12
                        Hello Lavafang,

                        Thank you for your response.

                        Realized PnL is not reported until the position is closed. And the values on the Account Performance tab of the Control Center will not update until the trade is closed and you select Generate.

                        The message "There is no market data available to drive the simulation engine" would indicate the instrument is not available for real-time data. If you are running 500 equities, then it is possible you are running into a limit on how many instruments data can be requested for from your data feed provider.

                        The Strategy will not pick up the orders from a previous instance, however, you could have it set to cancel orders upon disabling the strategy under Tools > Options > Strategies > NinjaScript.

                        I do not see why there should be an issue with enabling the strategies outside market hours.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by giulyko00, Today, 11:49 AM
                        2 responses
                        11 views
                        0 likes
                        Last Post giulyko00  
                        Started by Aviram Y, Today, 06:03 AM
                        2 responses
                        10 views
                        0 likes
                        Last Post Aviram Y  
                        Started by FishTrade, Today, 03:42 PM
                        0 responses
                        1 view
                        0 likes
                        Last Post FishTrade  
                        Started by Richozzy38, Today, 01:06 PM
                        3 responses
                        14 views
                        0 likes
                        Last Post Richozzy38  
                        Started by ttrader23, Today, 09:04 AM
                        2 responses
                        12 views
                        0 likes
                        Last Post ttrader23  
                        Working...
                        X