Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Execution only algo

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

    Execution only algo

    Hi there Ninja community

    I have an algo i made in the ninja trader strategy builder. I am trying to use it to execute my orders for me. its not a profitable strategy just a tool for executing orders. My problem is when i run it live it has virtual positions already open. How can i reset it so it starts trading for real again? other wise i have to wait for the virtual positions to clear which could take forever.

    Thanks in advance for any help
    Jack.

    #2
    Hello jmahon,

    Thanks for your post.

    In NinjaTrader8, to prevent the historical data/trades from being processed you can have the code "return" if it processing historical data.

    In OnBarUpdate() you can add:

    if (State == State.Historical) return; // do not process your code below this line if historical

    Please note that this means you would not be able to run backtests in the strategy analyzer. You may want to create a user input that allows you to turn on or off historical trades by enabling (or not) the above code line.

    Reference: https://ninjatrader.com/support/help...nt8/?state.htm

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello jmahon,

      Thanks for your post.

      In NinjaTrader8, to prevent the historical data/trades from being processed you can have the code "return" if it processing historical data.

      In OnBarUpdate() you can add:

      if (State == State.Historical) return; // do not process your code below this line if historical

      Please note that this means you would not be able to run backtests in the strategy analyzer. You may want to create a user input that allows you to turn on or off historical trades by enabling (or not) the above code line.

      Reference: https://ninjatrader.com/support/help...nt8/?state.htm
      Thanks for your help Paul, so this cannot be done in the strategy builder? I have to unlock the code?

      Comment


        #4
        Hello jmahon,

        Thanks for your reply.

        Sorry, I missed that you were using the Strategy Builder.

        Yes, you can do something similar by creating the condition (in each entry set) Left side Misc>Current state, center Equals, right side Misc>State>Real time

        Comment


          #5
          Originally posted by NinjaTrader_PaulH View Post
          Hello jmahon,

          Thanks for your reply.

          Sorry, I missed that you were using the Strategy Builder.

          Yes, you can do something similar by creating the condition (in each entry set) Left side Misc>Current state, center Equals, right side Misc>State>Real time
          Amazing! thank you very much Paul

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          52 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          130 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          70 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          43 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          48 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X