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 CarlTrading, 03-31-2026, 09:41 PM
          1 response
          45 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by CarlTrading, 04-01-2026, 02:41 AM
          0 responses
          21 views
          0 likes
          Last Post CarlTrading  
          Started by CaptainJack, 03-31-2026, 11:44 PM
          0 responses
          31 views
          1 like
          Last Post CaptainJack  
          Started by CarlTrading, 03-30-2026, 11:51 AM
          0 responses
          50 views
          0 likes
          Last Post CarlTrading  
          Started by CarlTrading, 03-30-2026, 11:48 AM
          0 responses
          42 views
          0 likes
          Last Post CarlTrading  
          Working...
          X