To get you started, check out the instructions on how to get R and NT7 to talk to each other.
In the thread, there is an example NinjaTrader 7 to R ADF Test indicator. ADF is Augmented Dickey–Fuller test, testing for a unit root in a complicated set of time series modules.
The testing procedure for the ADF test is the same as for the Dickey–Fuller test but it is applied to the model
Now personally my head just exploded. But for those with an understanding in mathematics, this type of integration can be an invaluable resource for your advanced trading systems.