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
technique to automatically connect to account on launch
Collapse
X
-
Originally posted by r2kTrader View PostRayNinjaTrader Customer Service
-
Ray,
I am thinking of starting a development wiki where developers can share their findings and further document items which NT might not have the interest in doing. Before I did so, would you be open to perhaps setup up a vanilla wiki "devwiki.ninjatrader-support2.com" or something like that and then assigning a few individuals to be moderators? Maybe some of your consultants or advanced programmers who could benefit from the lead generation it may provide for volunteering their time?
Perhaps there can be a small few to join or something as well.
We could let Dierk write the disclaimer regarding how it is not supported by NT.
I love NT, but this part is driving me buggy. I really lost it today when I saw this thread and I was trying to figure all this out on my own. It was right here all along. I am also noticing that the forum is really spending a lot of time answer the same questions over and over again. It's getting a bit crazy.
Originally posted by NinjaTrader_Ray View PostI apologize if my original reply to your "Open source" thread about our business model was unclear. Our model is to provide an end to end trading platform with development capabilities using C#. Our current supported methods/properties are clearly documented. Anything found outside of that is not supported. Our policies for providing community help align to what is officially supported. If what we support does not meet your requirements then likely a full .NET trading framework is the right product for you. The differences are not a misunderstanding. It would seem you want something I can't give you.
Comment
-
Marc,
I'm a newbie on the C# side, but maybe you could look at the .xml file that stores the workspace. You will see that it is order.
I am going to try this and then report back to the forum.
1. Follow your instructions.
2. Save the xml file that is generated.
3. make a new workspace the way I would want it.
4. take the code specific to the chart with your indicator on it and put it at the top of all the other charts, etc. and see if it works.
My thinking is that you can overcome your concern about the other windows by increasing the sleep timer and putting your code at the top of the xml. I'm going to try this if only to learn more about how things interact.
It be as simple as having some code that will automagically insert your code at a specific spot in the default.xml file based on a bool of some kind. Turn on/off auto load/start. Just a wild thought. But if you are doing a workspace to fire this, then there might be something to my thinking.
Thanks Marc, I hope you return to the boards!
Originally posted by marc.newlin View PostHello,
Attached is an updated version of this class with the ability to add strategies. To use it, do the following:- Add the NinjaTraderContoller.cs file to the NinjaTrader.Custom project if you are using Visual Studio. If you are using the NinjaTrader editor, create a new indicator called "NTController" and copy and paste the C# code from the NinjaTraderController.cs file.
- In the top of the NTController class, you will see two constants, AccountDisplayName and AccountName. Set these to correct account names you wish to use. Do not use Simulated Data Feed as it will popup a message box which will block and interfere with loading the strategy.
- Save and compile the indicator
- Setup the default workspace so it contains only a single chart, with the indicator NTController. Please make sure you just have the one chart set to load with the default workspace. If you have additional charts they will block while the NTController constructor is running and prevent the New Strategy dialog from being displayed.
- Close and restart NinjaTrader, and it should now connect to your account, and, in this example, add an instance of the SampleMACrossOver strategy.
The code to add the strategy and assign its properties is currently located in the NTController constructor. It should be pretty straight forward, but let me know if you have any questions.
This can be easily modified to connect to multiple accounts, flatten the accounts on startup, load multiple strategies, etc.
I will be posting another version sometime next week with some additional functionality including loading charts.
Best Regards,
Marc
DISCLAIMER This is just a proof of concept and has not been tested. Please do not use it in a production environment until you have familiairized yourself with how it works and have tested it.
Comment
-
Ok,
Here is what I did. I put this in my strategy that I am autoloading in the Initialize().
Please see the post for details and get involved in the thread.
Essentially, the command will "change workspaces upon the loading of the strategy. The dummy workspace will fire the NTCommand and that in turn will launch your strategy, which has the command to automagically change workspaces.
This allows you to now tie your workspace to a specific strategy.
I am also working on a method that will AUTO SAVE YOUR WORKSPACE every so often while you work. You can even timestamp it so you can go back in time and look at different versions. Helpful if you are developing strategies or trying to get your workspace the way you like it.
Using this command will also allow for you to launch different workspaces based on the size of the monitor(s) you are running. So you can investigate windows to get that info, then call the workspace that is best fit for that computer. Helpful if you move around like I do between notebooks, and servers, and PCs.
Originally posted by r2kTrader View PostMarc,
I'm a newbie on the C# side, but maybe you could look at the .xml file that stores the workspace. You will see that it is order.
I am going to try this and then report back to the forum.
1. Follow your instructions.
2. Save the xml file that is generated.
3. make a new workspace the way I would want it.
4. take the code specific to the chart with your indicator on it and put it at the top of all the other charts, etc. and see if it works.
My thinking is that you can overcome your concern about the other windows by increasing the sleep timer and putting your code at the top of the xml. I'm going to try this if only to learn more about how things interact.
It be as simple as having some code that will automagically insert your code at a specific spot in the default.xml file based on a bool of some kind. Turn on/off auto load/start. Just a wild thought. But if you are doing a workspace to fire this, then there might be something to my thinking.
Thanks Marc, I hope you return to the boards!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Aviram Y, Today, 05:29 AM
|
0 responses
1 view
0 likes
|
Last Post
by Aviram Y
Today, 05:29 AM
|
||
Started by quantismo, 04-17-2024, 05:13 PM
|
3 responses
25 views
0 likes
|
Last Post Today, 05:23 AM | ||
Started by ScottWalsh, 04-16-2024, 04:29 PM
|
7 responses
34 views
0 likes
|
Last Post Today, 05:15 AM | ||
Started by cls71, Today, 04:45 AM
|
0 responses
6 views
0 likes
|
Last Post
by cls71
Today, 04:45 AM
|
||
Started by mjairg, 07-20-2023, 11:57 PM
|
3 responses
216 views
1 like
|
Last Post
by PaulMohn
Today, 04:22 AM
|
Comment