We often Print custom messages in our NinjaScript which are
printed in the Output Window. But sadly the color of the messages in the Output
Window is, by default Black and cannot be changed. Custom colors helps one to
differentiate between various messages easily and are of very helpful in RT. dsOutputWindow
library
is an alternate to the native Output Window, which allows one to Print custom
messages in custom colors.
How to use the library.
1. Make sure NinjaTrader is not running. If it's running then close it.
2. Copy the dsOutputWindow.dll to "<My
Documents>\NinjaTrader 7\bin\Custom\" folder.
3. Start NinjaTrader.
dsOutputWindow library is all ready to use. Just add a reference of the dll in you
custom NinjaScript and you are all set.
Right-click on any NinjaScrpt and click on Reference. Add the dsOutputWindow.dll
in the list.


An example on how to
implement the same in your custom indicator or strategy.
First make the following declaration.

call the dll in Initialize on OnStartUp (in case of NT7)

call the Print sub to print your custom message with your custom color. This
usually goes in the OnBarUpdate or OnMarketData sub.

and don't forget to clear up the resources when you are done.

And finally a word of caution
Use the library entirely at your own risk. I am NOT
responsible for any damages whatsoever arising due to the use of it, directly or indirectly. |