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

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.
    Emily C.NinjaTrader Customer Service

    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.
        Emily C.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,788 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X