NinjaTrader 8
Guide on how to integrate licensing library into NinjaScripts
Adding licensing to your NinjaScript
After you have created your NinjaScript, you will need to integrate Licensing Library to validate users' licenses and protect your product from unauthorized distribution.
Save PoshTrader.Licensing.dll into %UserProfile%\Documents\NinjaTrader 8\bin\Custom\
Restart the NinjaTrader platform so it can load the external library
Add the library as a reference (right-click in NinjaScript Editor > References…)
Import namespace of the library by adding
using PoshTrader.Licensing;
Add Item Attributes to the main class
Validate library origin to prevent tampering
Create
ItemLicense
on the startupCheck license status during runtime
Creating a distribution file
To create the distribution file, please follow the steps below for creating an archive file containing your NinjaScript.
From the Control Center window select the menu Tools > Export > NinjaScript Add-On… to open the “Export NinjaScript” dialog window
Select the option “Export as compiled assembly”
Select “Protect compiled assembly” (For information on protection read here)
Press
Add
buttonSelect all of the files required, including
References – PoshTrader.Licensing
and pressOK
A list of all files that will be exported will be shown
Press the
Export
button to export the selected filesA file dialog will open where you can choose the location to create your distribution file.
Add
PoshTrader.Licensing.dll
to the exported archive file.
By default, the NinjaScript Archive File (.zip) file will be created in %UserProfile%\Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript
Last updated