I've recently imported around 20 years of historical intraday Forex data for 34 currency pairs, but I can't figure out a sensible way to run a statistical analysis of this data using NinjaTrader.
For each currency pair, I need to loop through every bar, calculate some statistics and write the results to a text file for analysis in another application. This then needs to be repeated for 8 different time frames.
I've already written some custom indicators for doing the calculations, but it's not obvious to me how I can use these in another script that is neither an indicator nor a strategy. From the NT documentation, it seems that I might be able to do what I need with a strategy, but only if I manually run it 34 x 8 times. Also, I can't figure out how to "page" through the historical data without loading it all at once, which I probably don't have enough Ram to handle. So, I would probably end up having to run the script several thousand times, then repeat this whenever I make a change!
The obvious solution would be to use a script that does something like this:
- loop through instruments - loop though time frames - loop through data with x bars loaded in memory at any one time - do calculations - save data to text file
Thanks
Marcus
Comment