Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja trader connection

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

    Ninja trader connection

    i have a problem and i thought on solution for it , i want a software/script/code etc, that when ninja trader goes disconnected , it will try to reconnect few times with delay of few seconds/minutes each time and if it cannot reconnect after x tries it should flat the trades and limits from the broker website (Apex trading) , (im using a vps).​

    #2
    Hello elad30,

    Thank you for your post and welcome to the NinjaTrader forum community!

    The platform already has built-in connection logic that attempts to reconnect on a connection loss. This happens when you see the connection turn yellow and red in the Control Center; it is only fully disconnected when the connection goes back to grey and a disconnection is logged in the Log tab of the Control Center.

    When working with NinjaScript strategies, there are some connection loss settings that may be found at Control Center > Tools > Options > Strategies > NinjaScript:


    This allows you to decide how long of a disconnection must occur to attempt to restart the strategy, how many times to attempt to restart, and how many minutes it should attempt to restart.

    As for your idea to flatten the trades and limits from the broker website, that would go outside the scope of support the NinjaScript team could offer since it requires communicating with the website for Apex. That may or may not be possible, though it is not documented in the NinjaTrader platform information and the available NinjaScript methods and properties would require an active connection to your broker in the platform to be able to submit any requests to flatten positions or cancel trades.

    Please let us know if we may be of further assistance.

    Comment


      #3
      Originally posted by NinjaTrader_Emily View Post
      Hello elad30,

      Thank you for your post and welcome to the NinjaTrader forum community!

      The platform already has built-in connection logic that attempts to reconnect on a connection loss. This happens when you see the connection turn yellow and red in the Control Center; it is only fully disconnected when the connection goes back to grey and a disconnection is logged in the Log tab of the Control Center.

      When working with NinjaScript strategies, there are some connection loss settings that may be found at Control Center > Tools > Options > Strategies > NinjaScript:
      https://ninjatrader.com/support/help...strategies.htm

      This allows you to decide how long of a disconnection must occur to attempt to restart the strategy, how many times to attempt to restart, and how many minutes it should attempt to restart.

      As for your idea to flatten the trades and limits from the broker website, that would go outside the scope of support the NinjaScript team could offer since it requires communicating with the website for Apex. That may or may not be possible, though it is not documented in the NinjaTrader platform information and the available NinjaScript methods and properties would require an active connection to your broker in the platform to be able to submit any requests to flatten positions or cancel trades.

      Please let us know if we may be of further assistance.

      Hello, im not using strategies i just need that when my ninjatrader is disconnected so it will reconnect , im copying trades from someone and i need it to be sync , so you think it can work also without strategies?​

      Comment


        #4
        Originally posted by elad30 View Post


        Hello, im not using strategies i just need that when my ninjatrader is disconnected so it will reconnect , im copying trades from someone and i need it to be sync , so you think it can work also without strategies?​
        Without strategies, you could use the Connection class in a custom script such as an add-on:

        You could subscribe to connection status updates:


        Then, if the connection is disconnect you could write logic to call Connect() to attempt a re-connect to a connection:


        Connection status event args may be found in the help guide here:


        Please let us know if we may be of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X