Everything we do at TRADE THE PLAN is designed to help traders perform exceptional market analysis as efficiently as possible. We aim to remove as many tedious and repetitive actions using automation, thereby yielding the trader more time to trade. Saving just 15 to 20 minutes per may seem insignificant, but every minute saved is a minute earned – it adds up.
One of the issues the Ninja Manager takes care of has to do with data corruption. Since the backbone of our trading methodology is Market Geometry (trend lines, channels, and median lines (pitchforks), we must ensure that our price data is 100% accurate with no missing chunks of data anywhere within the entire historical database. The Ninja Manager has a ‘Delete cache’ function that can automatically clear your data cache once per week (or once per day) before starting up NinjaTrader 8. I added this option because the data caches within the Documents\NinjaTrader 8\db folder can occasionally get corrupted, leading to chunks of missing data that typically occur right around the session close and reopen, sometimes lasting up until midnight or the following day’s open.
Most users will never even notice that they have any missing or corrupted data. However, because I am continually drawing so many trend channels and median lines on my charts and then exporting those objects to other users, I am notified right away when their imported objects do not line up with mine. Having chunks of data missing turned out to be a widespread issue and common occurrence within our community. (I expound upon the importance of keeping your clock in sync further down in this document under the ‘Delete caches’ section, offering a few solutions that you can implement to mitigate this issue.)
I haven’t been able to pinpoint all the exact causes for these gaps in data, but I believe I have figured out a couple of them. One issue contributing to data cache corruption is when your computer’s clock is out of sync with the actual atomic time – even if it’s only a few seconds. Keeping your computer’s clock in sync with the true atomic time (as do the managers of the data servers) is a very important requisite to keeping your data clean.
Another potential cause for database corruption is when you have NinjaTrader 8 set to connect to your data feed(s) on startup. Opening NinjaTrader 8 with a rather large workspace with many charts with various instruments that are all downloading data right at the same time when NinjaTrader is trying to connect to the data feed can be problematic. However, in a recent update of NinjaTrader 8, they made a change that allows only one workspace to open upon startup – the last workspace showing when it was last closed. I have no idea whether this functionality was introduced to mitigate what I’ve previously described or simply to eliminate the possibility of a user having multiple workspaces open without knowing it – probably the latter. In any case, we identified a problem for our members and then developed a solution. The Ninja Manager was born.
The Ninja Manager fully automates the entire NinjaTrader 8 startup process breaking it up into a sequence of steps, making sure each action finishes before beginning the next, so there is minimal chance of hanging/freezing or database/XML corruption.
The Ninja Manager will automatically take care of this procedure for you every day, ensuring that your NinjaTrader workstation is properly set up and ready for trading before you sit down.
- Delete part (or all) of your data cache folder(s) once daily or one day per week before starting up NinjaTrader 8.
- Open NinjaTrader 8 (32bit, 32bit high-priority, 64bit, or 64bit high-priority) at an exact time, any (or every) day of the week.
- Open NinjaTrader 8 automatically when your computer starts up, allowing for complete automation of your pre-market trading prep if configuring your BIOS to boot on a timer.
- Auto-answer NTMessageBoxes during startup, so startup doesn’t halt, copying the messages’ text into the Ninja Manager log.
- Startup NinjaTrader 8 with an empty/blank workspace before connecting to data feed(s) next.
- Connect to multiple user-defined data feeds in a specific order, connecting to an End-of-Day data feed first, your main historical intra-day data feed second, and your brokerage’s order routing data feed third.
- Open any user-defined workspaces for NinjaTrader 8 in a specific sequence.
- Open and handle each chart within the workspace one by one and wait for all charts to finish loading before opening the next workspace in sequence.
- Switch back to a specific workspace upon completion.
- Lock your computer upon completion for security.
The Ninja Manager needs the following minimum system requirements:
- Windows 8, Windows 8.1, or Windows 10 Operating System (also works with Windows Vista, Windows 7, or Windows Server 2003)
- 1024 x 768 – Minimum screen resolution
- P4 Processor – or higher
- 2 GB RAM – Recommended 4+ GB RAM
- 3 Mbps DSL – Broadband Internet DSL/Cable – Download Speed of 3 Mbps or faster
- .NET 4.5 – Microsoft .NET Framework 4.5 (pre-installed on most PCs or downloaded from Microsoft)
The Ninja Manager runs as a C# application, standalone/independent from NinjaTrader. The application can be run by double-clicking on the Windows Icon (named Ninja Manager) or finding ‘Ninja Manager’ in the list of programs via the Start Menu.
Follow these steps to install the Ninja Manager properly:
- Locate the downloaded NinjaManager 8.x.x.msi file. Double-click to launch the installer.
- Follow the prompts from the Setup Wizard. Left-click on the ‘Next’ button.
- Select ‘I accept the terms in the License Agreement’ and then click ‘Next.’
- Select the folder that you would like to install the Ninja Manager and then left-click the “Next” button to continue the installation (default location: C:\Program Files (x86)\TradeThePlan\NinjaManager8)
- Click ‘Install’ to begin the installation process.
- After following the prompts, the Setup Wizard will inform you that the installation is complete. Click the ‘Finish’ button to complete the installation process.
- Press the Windows key to open the Start Menu (between CTRL and ALT to the left of the spacebar).
- In the search field, type in “Ninja Manager.”
- Click on “Ninja Manager.”
- Look for the “Ninja Manager” icon on your desktop.
- Double left-click the Icon to open the Application.
The Ninja Manager interface consists of the Client menu and Topmost toggle, located on the upper blue strip. The Actions and Startup settings tabs. Switching tabs will change the content displayed below the tabs.
Enabling the Topmost toggle will cause the Ninja Manager to display ‘always on top’ of other applications or windows, even if the Ninja Manager is not the active selected window.
Left-clicking on the ‘Client’ menu will display the following menu items:
These settings control how the Client (Ninja Manager) is handled during different events. You will notice that the menu items are separated by horizontal lines, which group the options into three groups. Only one (or no) menu item can be selected from the center group.
Once Ninja Manager is running, you can enable ‘AutoStart Client when Windows starts.’ When enabled, the Ninja Manager application will start automatically shortly after Windows starts.
Sets the Ninja Manager to ‘Run Schedule’ as specified within the ‘Startup Settings’ tab. Upon the next startup, you will see a notification message in the Actions Log showing when the next startup is scheduled.
Sets the Ninja Manager to open NinjaTrader 8 every time the Client is opened. It will execute the “Run Now” procedure with the settings specified in the “Startup settings” tab.
Sets the Ninja Manager to open NinjaTrader 8 every time the Client is auto started by Windows and not when manually opening the Ninja Manager. It will execute the “Run Now” procedure with the settings specified in the “Startup Settings” tab.
If enabled, the Client will remain active in the Windows System Tray after closing the Ninja Manager application.
Please note that closing the application while a schedule is active will automatically minimize the Client to the Tray, irrespective of the “Send to Tray” settings.
If enabled, the Client will minimize the Windows System Tray rather than minimizing to the Taskbar, which is helpful if you want to keep your Taskbar clear.
- On the left, you will be informed of recent logs completed by the Ninja Manager, such as opening workspaces, connections, and loading status.
- The display box on the right will cycle between advertisements for TTP products you do not yet own or a notification about a coming webinar (therefore, the Ninja Manager is a free tool, as it gives us a non-invasive way of informing users about our tools and training)
- Click ‘Run Schedule’ to run NinjaTrader as per the schedule and settings specified in the ‘Startup settings” tab.
- Click ‘Run Now’ to run NinjaTrader manually as per the settings set in the ‘Startup settings’ tab.
The Startup settings window is divided into five sequential steps that flow from left to right. Because ‘Schedule’ is not always required, it is separated from the other four flow steps, so there are 1 + 4 sequential steps in effect. The other four flow steps work for ‘Run Now’ and “Run Schedule.’
The sequential steps are:
Schedule -> Startup -> Connection -> Workspaces after connect -> After done
All settings/changes are saved automatically upon closing the Client. However, it is also possible to Save and later Load your settings by using the Interface at the bottom left of the ‘Startup Settings’ tab.
Choose which days of the week you would like the Ninja Manager to open NinjaTrader and load your charts and the time that you would like to start the process.
To adjust the set times, select the top box and enter the time manually with your Numpad. Times are displayed in an HH:MM format (hours and minutes).
- Use the mouse scroll wheel to adjust set times.
- Click in the top time box (above Sunday’s time) to adjust all the days’ times together.
- NT8 exe – Run NinjaTrader 8 64-bit version (Switch to x32 if you are running Windows 32-bit version)
- Priority – Selecting to run NinjaTrader as “High” makes the NinjaTrader application run at a higher priority than other applications/processes running on your computer with a lower priority.
- Use empty workspace – Forces NinjaTrader to open with an empty workspace, allowing NinjaTrader to connect to data before loading charts. We recommend keeping this setting on as attempting to load multiple workspaces and charts with several instruments all at the same time while NinjaTrader is trying to connect to the data feed(s) can potentially lead to issues such as corrupt data caches and lockups. Everything runs more smoothly and stably when the startup process is handled in a step-by-step sequence.
*Note: this setting is grayed out when the ‘Don’t change‘ checkbox is selected in the ‘Workspaces after connect‘ sequence step.
- Answer message boxes – The Client will attempt to automatically answer NinjaTrader pop-up messages (NTMessageBox), as some of these messages halt the startup process. However, certain messages cannot be handled, such as the ‘New add-ons’ messages, as those must be manually confirmed. We cannot guarantee that NinjaManager will answer all messages correctly, so please USE THIS FEATURE AT YOUR OWN RISK.
The automatic answers are:
Ok for ‘Ok – Cancel’ message box (handled messages’ text is displayed in the log)
Yes for ‘Yes – No – Cancel’ message box (handled messages’ text is displayed in the log)
Yes for ‘Yes – No’ message box (handled messages’ text is displayed in the log)
- Wait for a chart – When loading a workspace with multiple charts present, the Client will monitor and load each chart, checking if the chart has finished loading before opening the next workspace. The set value specified is the maximum time the Client will allow the charts to finish loading before moving on to the next workspace. The timer is reset after each successful chart is loaded. If, for whatever reason, a chart takes longer than the value specified, the Client will display a “chart timed out” message in the log window and will proceed to load the next workspace. The default setting is 20 seconds, but I set it to 30 seconds.
- Delete caches – One of the issues the Ninja Manager takes care of has to do with data corruption. Since the backbone of our trading methodology is Market Geometry (trend lines, channels, and median lines (pitchforks), we must ensure that our price data is 100% accurate with no missing chunks of data anywhere within the entire historical database. The Ninja Manager has a ‘Delete cache’ function that can automatically clear your data cache once per week (or once per day) before starting up NinjaTrader 8. I added this option because the data caches within the Documents\NinjaTrader 8\db folder can occasionally get corrupted, leading to chunks of missing data that typically occur right around the session close and reopen, sometimes lasting up until midnight or the following day’s open.
Most users will never even notice that they have any missing or corrupted data. However, because I am continually drawing so many trend channels and median lines on my charts and then exporting those objects to other users, I am notified right away when their imported objects do not line up with mine. Having chunks of data missing turned out to be a widespread issue and common occurrence within our community.
I haven’t been able to pin down all the exact causes for these gaps in data, but one issue contributing to data cache corruption is when your computer’s clock is out of sync with the actual atomic time – even if it’s only a few seconds. Keeping your computer’s clock in sync with the true atomic time (as do the managers of the data servers) is a very important requisite to keeping your data clean.
Keeping time in sync between servers is so important, in fact, that there is a large German company dedicated to doing just that – Meinberg Global. I recommend using some sort of Time Sync app to ensure that your PC is always in sync. Windows’ Time Sync tool is not very easy to automate, and there are some issues with it. I have chosen to use THIS ONE, but there are at least a few other similar tools. To read an article about some of the different options, visit THIS PAGE. You can find a list of the time servers closest to you in your country on THIS SITE. With the tool that I use, I simply find the four servers for the U. S. and paste them into the UI:
The first time you select the ‘Delete caches’ options, you will be presented with a popup message as a disclaimer signifying that you understand the purpose and result of this functionality:
The data cache folders are split into four different folders. You can select any or all the folders, but if the Delete caches option is checked and none of the folders is selected, you will be presented with the following message in the log after running the Ninja Manage: Cache was not deleted – Please select a folder to delete
- Cache – folder containing workspaces’ charts’ data that is segmented into the various sessions associated with each chart’s instrument
- Tick – folder containing all the tick data for each downloaded instrument
- Minute – folder containing all the minute data for each downloaded instrument
- Day – folder containing all the daily data for each downloaded instrument
All bar types that are not minute or daily bars are created from tick data. Tick data is by far the most resource-intensive data to download and manipulate, and the more volume traded for a given instrument, the denser its tick data.
The “Except From/To” time fields allow you to set a time window during which the Ninja Manager will not be allowed to delete the cache folders. I added this option because many data feeds put time constraints on the time of day that tick data can be downloaded. For example, DTN IQ Feed and Kinetick allow downloading only up to eight calendar days’ worth of historical tick data when downloading during business hours (I believe between 8:30 PM and 4:00 PM Central Time). Outside of business hours, they allow downloading up to 180 days’ worth of tick data.
When the Delete caches option is checked with a set exception time window and your computer clock is inside of this exception time window, you will see the following message in the log after running the Ninja Manager: Cache was not deleted – Inside of exception time window
Just above the “Except” option is a Day-of-Week selector that allows you to choose whether to delete the cache folder(s) each day or only on the selected day of the week.
When the Delete cache is checked with a particular day of the week set and you run the Ninja Manager on a different day of the week, you will see the following message in the log: Cache was not deleted – Today is not the selected day
*Note: The data cache can be deleted only once per day. If you run the Ninja Manager and it deletes the cache, and then you run it again later the same day, you will see the following message in the log: Cache was not deleted – Cache was already deleted once today
The limits on the Delete caches functionality are in place to limit the strain on the data servers and your computer. Deleting the data cache is not something that needs to be done very often. Once per week is more than often enough to ensure against corruption.
Wait for a chart – The second option for ‘Wait for a chart’ is used immediately following a cache-delete action as the maximum time that the Client will allow for each chart to load before continuing to the next action. The value is set to 90 seconds, as the TTP Master Suite workspaces have a very large Tick chart with about a 40-days lookback, and this chart can take a very long time to load after a deleted cache. The timer is reset after each successful chart is loaded. If, for whatever reason, a chart takes longer than the value specified, the Client will display a ‘chart timed out’ message in the log window and will proceed to load the next workspace.
- Select the data feed connection/s. You can connect to multiple connections. The order in which you click them will determine the order in which they connect.
- The connection order is displayed by a number to the left of the checkbox.
- NinjaTrader determines the source of data depending on your connection order. Data requests are first sent to your primary connection, if the provider does not offer the required instrument type, then the data request will be sent to the next connection. See this article on multiple connections.
- A NinjaTrader Multi-Broker license is required for multiple broker connections.
- Don’t change – When checked, NinjaTrader will start with whichever workspaces were open during the previous instance of NinjaTrader.
- Select the workspaces that you would like the Client to load. The order in which they load is determined by the order in which you click them.
- The loading order is displayed by a number to the left of the checkbox.
- Switch to – After completion, the Client will switch to the workspace of your choice.
- Show all windows – Will display all NinjaTrader charts/windows, from all open workspaces, irrespective of the active workspace. This is useful when used in conjunction with the Toolbar’s “Window Manager.”
- Close Client – The Client will close after running the sequence.
- Lock workstation – The Client will lock your PC, requiring the user to enter your Windows password or PIN to gain access again.
This section looks at some of the options available when utilizing the Ninja Manager to automate your startup process. Whether you decide to run the Ninja Manager automatically on a schedule, automatically after computer startup or manually using the ‘Run Now’ button to launch NinjaTrader, it’s important to allow NinjaTrader to complete the loading procedure before attempting to interact with your charts. Manually interacting with NinjaTrader while the Ninja Manager is autoloading can result in unexpected behavior. Please wait until you see the splash screen as shown below with the light blue ‘Click here to close NinjaManager’ button before attempting to click on any of your charts.
• Ninja Manager can be used to start NinjaTrader manually. To open NinjaTrader, click the “Run Now” button under the Actions tab view.
The Client will run through the sequence as defined by the settings in the Startup Settings tab. The sequence step “Schedule” is ignored during a manual run and will, therefore, follow the sequence as shown below:
Startup -> Connection -> Workspaces after connect -> After done
This is a great option for users looking to trade the Afternoon session. For example, you have been using your PC in the morning, and you’d like NinjaTrader to load only later in the day (not when first booting Windows.) You can set NinjaTrader to load at a specific time of the day.
- Set up the settings via the “Startup settings” tab and ensure you have specified the time and day for the schedule to run.
- Click the “Run Schedule” button from the “Actions” tab to await the next scheduled startup.
- Alternately the Client can be set to automatically “Start schedule when Client starts” as shown in the image above.
- You may want to enable “Send to tray when minimized” to hide the Ninja Manager from your Taskbar.
To start Ninja Manager from boot up (when your PC is first powered on), you will need to enable “Autostart Client when Windows starts” from the “Client” menu. Enable either ‘Start NinjaTrader everytime when Client starts’ or ‘Start NinjaTrader when Client is autostarted by Windows.’ The Sequence settings for ‘Schedule’ (time and day) do not need to be set, as the PC booting up triggers the NinjaTrader startup event.
Note: When using the “Autostart Client when Windows starts” feature, you could also configure your computer’s BIOS to auto-boot on a schedule. An example of this would be setting a boot time for 6 AM every morning to ensure that all your charts are ready to go when you arrive at your computer to trade at 7 AM. Please refer to the next section “Automating Computer Startup in BIOS” for more details. The process of setting an automatic computer startup schedule in the BIOS is specific to the motherboard of the user. More information can be found online to help in setting this up.
The following is an example of how to achieve this with an ASUS motherboard running the ASUS UEFI BIOS Utility (this process should be similar, but likely not identical to this example for other motherboard manufacturers / BIOS utilities):
- Boot into the BIOS. The keypress needed to open the BIOS will vary depending on the motherboard manufacturer. For an ASUS motherboard, either the ‘F2’ or ‘Delete’ key may be pressed while the system is booting to enter the BIOS. (Additional resources: https://www.asus.com/support/faq/1013015/)
- Once in the BIOS, select ‘Advanced Mode’
- Select ‘Advanced’
- Select ‘APM Configuration’
- Select ‘Enabled’ under the ‘Power On By RTC‘ dropdown
- Enter ‘0’ in the ‘RTC Alarm Date (Days)’ field for a daily boot and specify the time below.
- Press ‘F10’ to save and exit, then press ‘OK’ when prompted to allow the computer to restart with the saved BIOS settings.
By default, Windows may have the fast startup feature enabled. This must be disabled to allow for RTC scheduled startups to trigger.
- Open ‘Power Options’ by searching for ‘power options’ in the Windows start menu (or open the Control Panel and type this in the address bar: Control Panel\Hardware and Sound\Power Options\System Settings)
- Select ‘Choose what the power buttons do.’
- Click “Change settings that are currently unavailable” and then uncheck the “Turn on fast startup” checkbox.
- Press Win + R to open the Run dialog and enter ‘netplwiz’ and click ‘OK’
- Select the appropriate User Account from the list of users and uncheck the ‘Users must enter a name and password to use this computer’ checkbox. Then click ‘OK’ to save and close the window. (Source: https://www.tekrevue.com/tip/skip-windows-10-login-screen/)
That’s it! You can see the issue, though, I’m sure. You must disable the password requirement to access your computer after startup. This is likely not an option for many people, but some will surely find it useful. One thing to note, though, is that you can force NinjaManager to lock your computer once it finishes, so your computer would only be accessible for a short time after it auto-starts.