NinjaTrader 8
Guide on how to integrate licensing library into NinjaScripts
Last updated
Was this helpful?
Guide on how to integrate licensing library into NinjaScripts
Last updated
Was this helpful?
After you have created your NinjaScript, you will need to integrate to validate users' licenses and protect your product from unauthorized distribution.
Save 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 startup
Check license status during runtime
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”
Press Add
button
Select all of the files required, including References – PoshTrader.Licensing
and press OK
A list of all files that will be exported will be shown
Press the Export
button to export the selected files
A file dialog will open where you can choose the location to create your distribution file.
Add PoshTrader.Licensing.dll
to the exported archive file.
Select “Protect compiled assembly” (For information on protection )