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

Strategy not working live

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

    Strategy not working live

    Hello
    I have created a simple strategy using the strategy builder and it works great on the strategy analyzer but it's not executing a single trade live.
    what could the problem be? I've look some of the previous posts but are not helping much

    #2
    Hello Mathias79,

    Is the strategy shown as green in the control center strategies tab?

    We would otherwise need more specific details on what you made to know why that may not be working.
    JesseNinjaTrader Customer Service

    Comment


      #3
      is this the way it's supposed to show?
      Attached Files

      Comment


        #4
        what details would you need? is there anything I can email you directly?

        Comment


          #5
          Hello Mathias79,

          Yes that means its working in Realtime when its green.

          In this case you would have to explore the conditions you made to know why its not trading in realtime. If you can post an image of your entry condition that may help. You can otherwise use a new empty set to add Misc -> Print actions with the values you use in your entry condition to see what values are showing up in realtime, that would give you a better idea of why the condition to trade is not becoming true.
          JesseNinjaTrader Customer Service

          Comment


            #6
            Here is an example where it worked in these couple of candles in the strategy Analyzer but not in the live chart
            Attached Files

            Comment


              #7
              Hello Mathias79,

              In this case you would need to add debugging into the script so you know why that condition is not becoming true. There are too many conditions in your set to know which part is making the overall set not work.

              To add debugging you can add a new set and do not add any conditions to that set. As the action of that set you can add Misc -> Print and then create a print statement that includes the items you have for conditions in the set that is not working. That will let you output the values to the NinjaScript output window for each bar to see which part is not becoming true.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Thank you very much for your help... I will follow everything you suggested... so the strategy can work on the analyzer but not live?

                Comment


                  #9
                  Hello Mathias79,

                  As mentioned there wouldn't be a way to tell why its not working in realtime without adding debugging based on the image of your conditions. You would need to see which part of the condition is not becoming true to know why that result is different. Depending on the settings of your strategy it can work differently in realtime vs a backtest because a backtest uses historical data and runs OnBarClose always. To know why its not working in realtime you would need to output what the strategies logic is doing so you know how to address the problem.

                  JesseNinjaTrader Customer Service

                  Comment


                    #10
                    In your picture, your account is set to Sim101. If I understand NT (and I'm very new), you need to set the Strategy to trade on the account you want it to trade on (your live account). I could be totally wrong though.

                    Chart Screen > Right Click > Strategies (or just Ctrl + S) > click on your strategy in the "Configured" window and change the account. I don't know if you have to disable and re-enable it again, but I probably would.

                    Comment


                      #11
                      Hello alphatango,

                      That would be correct if Mathias79 is trying to apply the strategy to a live account. The Sim101 can be used in realtime or live data to run a strategy as well.
                      JesseNinjaTrader Customer Service

                      Comment


                        #12
                        Clarification:
                        the Sim101 is a simulated account, correct? So setting the Sim101 account to the strategy simply uses the balance from the Sim101 account.
                        if you want to trade from your real balance, you would need to specify [YourRealAccount] as the Account, correct?

                        Comment


                          #13
                          Hello alphatango,

                          That's correct, that's the local simulation account. That uses the Sim101 account balance which can be reset locally. For live trading a live account would need to be selected instead.

                          Selecting Sim101 vs a live account should have no effect on the strategy not trading in realtime where it did place trades in historical. There could be differences in how a strategy processes in historical vs realtime which could prevent trading.

                          The strategy is listed as a green color in the control center which means its working in realtime so at that point if no trades are placed that would relate to the conditions to trade. The best way to address that problem is to review how the conditions are being evaluated in realtime by printing out the values used in the conditions. In the message that was removed there was an image of the conditions to trade which there are 9 total conditions so the next step would be to see which of those 9 conditions is false to know why the condition to trade was false.

                          JesseNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by jxs_xrj, 01-12-2020, 09:49 AM
                          6 responses
                          3,290 views
                          1 like
                          Last Post jgualdronc  
                          Started by Touch-Ups, Today, 10:36 AM
                          0 responses
                          7 views
                          0 likes
                          Last Post Touch-Ups  
                          Started by geddyisodin, 04-25-2024, 05:20 AM
                          8 responses
                          61 views
                          0 likes
                          Last Post NinjaTrader_Gaby  
                          Started by Option Whisperer, Today, 09:55 AM
                          0 responses
                          8 views
                          0 likes
                          Last Post Option Whisperer  
                          Started by halgo_boulder, 04-20-2024, 08:44 AM
                          2 responses
                          24 views
                          0 likes
                          Last Post halgo_boulder  
                          Working...
                          X