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 llanqui, Today, 03:53 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post llanqui
                  by llanqui
                   
                  Started by burtoninlondon, Today, 12:38 AM
                  0 responses
                  10 views
                  0 likes
                  Last Post burtoninlondon  
                  Started by AaronKoRn, Yesterday, 09:49 PM
                  0 responses
                  14 views
                  0 likes
                  Last Post AaronKoRn  
                  Started by carnitron, Yesterday, 08:42 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post carnitron  
                  Started by strategist007, Yesterday, 07:51 PM
                  0 responses
                  14 views
                  0 likes
                  Last Post strategist007  
                  Working...
                  X