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!
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
NinjaTrader
Ninja trader connection
Collapse
X
-
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).Tags: None
-
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
- Likes 1
-
Originally posted by NinjaTrader_Emily View PostHello 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
-
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?
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 | ||
---|---|---|---|---|
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
14 responses
1,788 views
0 likes
|
Last Post
by aligator
Today, 11:47 AM
|
||
Started by Jimmyk, 01-26-2018, 05:19 AM
|
6 responses
837 views
0 likes
|
Last Post
by emuns
Today, 11:27 AM
|
||
Started by jxs_xrj, 01-12-2020, 09:49 AM
|
6 responses
3,293 views
1 like
|
Last Post
by jgualdronc
Today, 10:56 AM
|
||
Started by Touch-Ups, Today, 10:36 AM
|
0 responses
13 views
0 likes
|
Last Post
by Touch-Ups
Today, 10:36 AM
|
||
Started by geddyisodin, 04-25-2024, 05:20 AM
|
11 responses
63 views
0 likes
|
Last Post Today, 10:08 AM |
Comment