Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Unexpected trades with Lin.Reg.

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

    Unexpected trades with Lin.Reg.

    Dear all,

    When using Linear Regression indicator in strategies, they make loads of unexpected trades in backtesting. Chart looks correct, but signals are often missed or orders are placed without signal. The screenshot shows an example using SMA cross LinReg with 60min bars. I really can not see anything wrong in this script from strategy builder. Is the problem in the indicator or somewhere else?

    Script.txt

    #2
    Hi,

    I mentioned in another topic about unexpected trades when back testing a strategy, but still waiting for response from support. Meanwhile, I am trying to find out where the problem is. It turned out to me there is bug in the system. You can easily repeat it, for example, just use the cross of two SMA to generate long/short orders and backtest with 60min bars. You will see signals are often missed.

    I am worried that such basic things are not working properly. Please do take a look and response.

    Comment


    • cliffhu
      cliffhu commented
      Editing a comment
      No. I didn't send you any email. But I raised the issue yesterday on this forum.

    • NinjaTrader_PatrickG
      NinjaTrader_PatrickG commented
      Editing a comment
      Please provide a link to that forum post so I may merge your post into that existing topic to keep topics organized.

    • cliffhu
      cliffhu commented
      Editing a comment

    #3
    Hello cliffhu,

    Thanks for your posts.

    I am sorry that we did not get a response to you yesterday.

    Please advise what version of NinjaTrader platform you are using (found under help>About) and what your data feed source is.

    Please run the platform provided strategy SampleMACrossover in your platform on the same data/time and advise if you see the same with this strategy.

    Paul H.NinjaTrader Customer Service

    Comment


      #4
      Hi Paul,

      Thanks for looking into this issue. My NT version is 8.0.20.1 64-bit and data feed is Kinetick.

      From NinjaScript Output, It seems all data and calculations are correct.

      SampleMACrossover has exactly the same problem. See the attached screenshot.

      Comment


        #5
        Hello cliffhu,

        Thanks for your reply and testing.

        In your first example of TDOC, the crossover on Aug2 was at the end of the session however your settings show that the Exit on session close was unchecked, if you would uncheck "Break at EOD" you will get a trade there.

        In terms of the 2nd example of XOM, the crossover of Oct 3 occurs at last bar of the session, if you change the "Time in force setting" from "DAY" to "GTC", the trades would occur.

        In the case of your last post, the crossover's just before Dec 23 and Dec 30 occur on the last bar of the session and you have "Exit on session Close" checked so this would be why there are no trades, if you uncheck Exit On session close, then you will see trades.

        For reference, here is a link to the section "Understanding backtest properties" in the page of: https://ninjatrader.com/support/help...a_strategy.htm





        Paul H.NinjaTrader Customer Service

        Comment


          #6
          Hi Paul,

          Thanks a lot.

          I somehow changed these settings and forgot them. I was also wondering why the problem happened only recently

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Christopher_R, Today, 12:29 AM
          0 responses
          9 views
          0 likes
          Last Post Christopher_R  
          Started by sidlercom80, 10-28-2023, 08:49 AM
          166 responses
          2,235 views
          0 likes
          Last Post sidlercom80  
          Started by thread, Yesterday, 11:58 PM
          0 responses
          3 views
          0 likes
          Last Post thread
          by thread
           
          Started by jclose, Yesterday, 09:37 PM
          0 responses
          8 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,415 views
          0 likes
          Last Post Traderontheroad  
          Working...
          X