Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy will not fire in live trading

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

    Strategy will not fire in live trading

    I am dipping my toe into the NinjaTrader C# programming, so I am an absolute rookie here. I have 2 strategies that were built in Strategy Builder, which did trigger orders at the appropriate times. I unlocked and applied them, and watching both this morning, neither triggered orders when they should have. If I then disable/enable the strategies, the chart shows that the orders did trigger at the appropriate time. This leads me to believe that there is a basic line of code I am missing?

    Thanks for your help.
    Last edited by SheriDi; 06-27-2024, 09:07 AM.

    #2
    Hello SheriDi,

    Were the strategies shown as green or yellow in the control center when you enabled them this morning? One possibility would be if the strategies were waiting to become flat from a historical position, that would prevent it from trading in realtime until that historical position is closed.

    Comment


      #3
      They were both green Jesse.

      Comment


        #4
        Hello SheriDi,

        In that case you would need to use prints to see why it may not be trading in realtime. The best way to do that in the builder is to add a new empty set at the end and then add the action misc -> print. For the text you can click set to open the string builder screen where you can pick indicators, price series or variables that you used in your condition. That output will go to the NinjaScript output window. I would suggest to print the bar time in addition to what you use in the condition so you can see the value for each bar. Let the script work in realtime and when you think it should have traded make note of the output at that time. Then reload the script and make note of the output for that time again, you can then compare the output to see why it worked historically but not in realtime.

        Comment


          #5
          Thanks Jesse. While I work on that, I have enabled my strategies this morning and they are triggering orders accurately, but ONLY after the first order has triggered AND I disable/enable them.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          50 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          126 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          69 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          42 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X