NexusFi: Find Your Edge


Home Menu

 





Utility To Transpose Optimized Strategy Values From Excel Output to Actual Strategy


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one sam028 with 2 posts (4 thanks)
    2. looks_two Big Mike with 2 posts (2 thanks)
    3. looks_3 mercuryfx with 1 posts (1 thanks)
    4. looks_4 nanook77 with 1 posts (1 thanks)
      Best Posters
    1. looks_one sam028 with 2 thanks per post
    2. looks_two Big Mike with 1 thanks per post
    3. looks_3 mercuryfx with 1 thanks per post
    4. looks_4 nanook77 with 1 thanks per post
    1. trending_up 3,240 views
    2. thumb_up 8 thanks given
    3. group 3 followers
    1. forum 5 posts
    2. attach_file 0 attachments




 
Search this Thread

Utility To Transpose Optimized Strategy Values From Excel Output to Actual Strategy

  #1 (permalink)
 
mercuryfx's Avatar
 mercuryfx 
Undisclosed
 
Experience: Intermediate
Platform: Ninja Trader
Trading: EUR/USD
Posts: 5 since Oct 2010
Thanks Given: 1
Thanks Received: 2

Hello Programmers & Sr. Members,

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.

Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
MC PL editor upgrade
MultiCharts
ZombieSqueeze
Platforms and Indicators
Trade idea based off three indicators.
Traders Hideout
Quant vue
Trading Reviews and Vendors
 
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,236
Thanks Received: 101,660

Yes, I can't think of the name but am calling @sam028 here so he can maybe help. There are some good free keyboard macro programs to do what you want.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #3 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


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 .

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #4 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,463 since Jun 2009
Thanks Given: 33,236
Thanks Received: 101,660


sam028 View Post
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 .

Yes I thought of this too, but it is more complicated. What is the name of the keyboard macro program you've used before with NinjaTrader?

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #5 (permalink)
 
sam028's Avatar
 sam028 
Site Moderator
 
Posts: 3,765 since Jun 2009
Thanks Given: 3,825
Thanks Received: 4,629


Big Mike View Post
Yes I thought of this too, but it is more complicated. What is the name of the keyboard macro program you've used before with NinjaTrader?

Mike

It was autohotkey.
Maybe easier than open a file and parse it in C# .

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
Thanked by:
  #6 (permalink)
 
nanook77's Avatar
 nanook77 
OKC, OK
 
Experience: Advanced
Platform: Ninja Trader, Trade Navigator. ToS
Broker: PFG/CQG
Trading: forex, futures
Posts: 23 since Jun 2010
Thanks Given: 84
Thanks Received: 8


mercuryfx View Post
Hello Programmers & Sr. Members,

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.

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!
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on April 7, 2012


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts