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 lightsun47, Today, 03:51 PM
        0 responses
        5 views
        0 likes
        Last Post lightsun47  
        Started by 00nevest, Today, 02:27 PM
        1 response
        10 views
        0 likes
        Last Post 00nevest  
        Started by futtrader, 04-21-2024, 01:50 AM
        4 responses
        46 views
        0 likes
        Last Post futtrader  
        Started by Option Whisperer, Today, 09:55 AM
        1 response
        14 views
        0 likes
        Last Post bltdavid  
        Started by port119, Today, 02:43 PM
        0 responses
        10 views
        0 likes
        Last Post port119
        by port119
         
        Working...
        X