Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Utility To Transpose Optimized Strategy Values From Excel Output to Actual Strategy
I have a strategy that has over 50 or so parameters. When I run the ninja trader optimizer for all 50 of the parameters I get an output that I can export to excel ... The problem is NT7 doesn't allow me to save a template with the optimized parameters that I can load onto my strategy for either forward testing or further extensive back testing across different periods of time.
It is extremely tedious for me to manually transpose the optimized inputs by looking at the excel spreadsheet and typing them onto my strategy. Also, with so many inputs, I often make mistakes that skews my results. If it were a one time thing then it would be OK, but as you know optimization requires many iterations and validation testing and having to manually transpose parameters from an excel spreadsheet to my strategy inputs within Ninja after each iteration is a big nuisance.
Does anyone know of any utility that would automatically transpose the optimized values from the excel output to my strategy in Ninja? Would anyone be able to create it easily? Thank you.
The excel output looks exactly like the strategy in Ninja, so it's a mapping exercise from Excel to Ninja.
What I've done in the past was having a strategy which was able to read a parameter file, a .csv or a .txt , and launch the strategy with the required parameters.
So you just need two versions of your strategy:
- the first one for backtesting,
- the second one for realtime runs, forward testing, ..., which will read a parameter file generated by the first strat.
I don't have any example here, but this is simple C# file management, not rocket science.
Keystroke generator is not the best way to that, in this case .
This may not be the most elegant, though have found it to be efficient and virtually error free. My steps are:
1. Run my analysis and export the optimizer results to excel.
2. On the Data tab, use the Test to Columns function and expand the parameters and post them at the end of the results (about column "L"
3. Go to the end of the text output and copy and paste the headers over the variable values.
4. Turn on the data filter so can sort and needed.
5. Here is a key portion. In MS Word, built a master template for the strategy in Mail Merge.
6. Link the Word strategy to the Excel file with appropriate sheet reference etc.
7. With this done, then as i step thru the results, I pick the strategies that reflect what i want to either backtest, forward test and/or run live.
8. The Mail Merge, in either preview or merge and edit mode, fills in all the variables right from the excel sheet out of the parameters section. "like you, i have about 50 variables that get optimized / updated monthly.
9. I just cut and paste from the MS Word Preview mode and put right in my NT strategy template.
10. Typically, am running up to 20 trade parameters within one strategy, so don't have to worry about overlapping trades as long as using 'unique entries' set to true.
11. This has proven to be virtually error free. There is the time to built the 'mail merge letter' with all the variables, and test that thoroughly for errors, and after that you are good to go.
12. Have attached a sample of the Word marco file, which must be opened in Word with macros allowed. This should give you a good starting point, i trust.
Hope this helps.
Even when you stand firm in the rushing waters of life - only your Spirit is Perfect!