• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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
      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 junposlee, Today, 02:59 PM
          0 responses
          1 view
          0 likes
          Last Post junposlee  
          Started by patpat, Yesterday, 11:02 AM
          2 responses
          8 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by jameslee001, Yesterday, 08:09 AM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by ArthurH, Today, 11:52 AM
          0 responses
          7 views
          0 likes
          Last Post ArthurH
          by ArthurH
           
          Started by Darylbe, Today, 11:51 AM
          0 responses
          5 views
          0 likes
          Last Post Darylbe
          by Darylbe
           
          Working...
          X