Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Cannot get Strategy to Trade

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

    Cannot get Strategy to Trade

    Attached is a simple stategy - it trades when I beacktest it however on live data no trades are made - what is going on?

    Thanks
    Mike
    Attached Files

    #2
    Hello Mike,

    Unfortunately, you will need to debug your strategy to check why it does not work as you expect. General debug information can be found at the link below.
    JasonNinjaTrader Customer Service

    Comment


      #3
      Jason,

      my concern is that the strategy makes trades when I backtest it but not on live data - I know that backtest data will always use the ask close when trading but I am not worried about that - the thing that concerns me is that it will not trade on live data but works fine on the backtest.

      thanks
      Mike

      Comment


        #4
        Hi Mike,

        Thank you for your reply.

        As Jason mentioned, you will need to determine why this occurs. Unfortunately, we are not able to provide troubleshooting for custom NinjaScript files.
        KyleNinjaTrader Customer Service

        Comment


          #5
          Kyle,

          sorry to keep bothering you guys - but do you know of anything that would allow a code to work backtesting but not moving forward?

          I am currently debugging the code to see where it fails but for future reference it would be nice to know.

          Thanks
          Mike

          Comment


            #6
            mikeod1066,

            If you do not want your strategy to process any real-time data you want to filter it with this line of code at the beginning of OnBarUpdate().

            Code:
            if (!Historical)
                 return;
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              does that mean if my code doesn't have;

              if (!Historical)
              return;

              and it trades backtesting then it should (in theory) work running forward?

              Comment


                #8
                If you remove those lines it will continue in real-time and trade when signals are true. Whether that will be profitable or not is a different story. Backtesting is inherently different than real-time trading. You should be familiar with this article before trading live: http://www.ninjatrader-support.com/H...TimeVsBacktest
                Josh P.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks Josh I think I have it solved now

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by jaybedreamin, Today, 05:56 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post jaybedreamin  
                  Started by DJ888, 04-16-2024, 06:09 PM
                  6 responses
                  18 views
                  0 likes
                  Last Post DJ888
                  by DJ888
                   
                  Started by Jon17, Today, 04:33 PM
                  0 responses
                  1 view
                  0 likes
                  Last Post Jon17
                  by Jon17
                   
                  Started by Javierw.ok, Today, 04:12 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post Javierw.ok  
                  Started by timmbbo, Today, 08:59 AM
                  2 responses
                  10 views
                  0 likes
                  Last Post bltdavid  
                  Working...
                  X