I am not experienced programmer, but I making a lot of market statistics using NT for myself.
Once I decided to use both cores of my laptop for lingering calculations, I found out that most examples cause NinjaScript errors or very complicated for my simple practical tasks.
At least, I found working code, that suits by it simplicity and minimalism. And I sharing it here.
This strategy create 2 massives of random double values. Lenght of massives (N) is one only parameter of this strategy.
Then strategy calculates control sum of both massives using resource‐intensive algorithm.
At first, control sum calculates using 2 new threads, than it calculate using ussual serial method.
Strategy print calculation time and control sum in output window.
1) Additional threads read and write to global variables (I know this is wrong, but it is work quick).
2) You can't access to arrays (like int i) from additional thread, You have to use List
For experienced programmers: please, don't read this description and don't look in attached strategy.
|File Size||1.4 KB|
|# of Downloads||208|
Importing to NinjaTrader 7 is Easy!
To import your 3rd party app or add-on to NinjaTrader, simply follow these 3 steps:
- Download the app or add-on file to your desktop
- From the NinjaTrader Control Center window, select the menu File > Utilities > Import NinjaScript
- Select the downloaded file from your desktop
Visit the NinjaScript File Sharing discussion in the NinjaTrader user forum to interact with fellow traders and the NinjaTrader support team.