This is my first non-introduction post. I am a bit surprised this hasn't been asked (to the best of my knowledge).
In NT7, is it possible to call an optimization from within a strategy? Just to be clear, I am not talking about a walkforward optimization.
What I would like to do is to have some parameters change in time as part of an optimal-adaptive strategy. Suppose, say, on each bar update, take the last N bars, and find parameters A, B, and C via the NT7 GA that are optimal in some sense. At the moment I am not concerned with over-fitting, or overcomplication. I just want to know if it can be done.
Congratulations on a very unclassic approach! From my point of view, knowing that GA optimization can take significant resources that I would NOT want to incur on a trading computer during trading, I have a suggestion:
Ha! You really think it is that unusual of an approach? From my background it isn't that unusual or new at all (which makes my surprise that this is unusual all the more). My completely uneducated guess is that the big institutional algorithmic traders certainly do something like this.
But, you bring up a good point. Stability is important, and an embedded optimization would not increase stability. A proof-of-concent may be to run another instance of NT on the same machine, and use the text file transfer. That may work (as unelegant as it is).
I may look into the third-party NT7-compatible GA I saw on this forum. Wonder if it is invoke-able from a strategy?
Coincidentally I thought about such an approach a week ago or so in the context of implementing an Encog-framework neural net (NN) -based strategy for NinjaTrader ("NT") -- not that I've developed a worthwhile NN-based strategy yet. By default the Encog configuration offloads training from any NN-based indicator or strategy to a separate C# (or Java) application IIRC mainly because of the processing burden.
I also agree the best approach may be sockets and poked around CodeProject.com a little to see what's involved. In brief it appears doable, the approach being to develop a DLL, refer to it in the NT NN-based indicator or strategy and periodically invoke the separate application with a training set via the DLL.
It may be also be possible (perhaps more reasonable) to work the other way around; namely, broadcast optimized parameters through a socket from a "server" training/optimization app (possibly including NT's strategy optimizer if the socket interface were embedded in the strategy), to be picked up by a live "client" strategy.
I'm not sure if it's an issue but one might have to be careful not to breach any rules regarding redistribution of data provided by a 3rd party.
The following 2 users say Thank You to bnichols for this post:
Due to time constraints, please do not PM me if your question can be resolved or answered on the forum.
Need help? 1) Stop changing things. No new indicators, charts, or methods. Be consistent with what is in front of you first. 2) Start a journal and post to it daily with the trades you made to show your strengths and weaknesses. 3) Set goals for yourself to reach daily. Make them about how you trade, not how much money you make. 4) Accept responsibility for your actions. Stop looking elsewhere to explain away poor performance. 5) Where to start as a trader? Watch this webinar and read this thread for hundreds of questions and answers. 6) Help using the forum? Watch this video to learn general tips on using the site.
If you want to support our community, become an Elite Member.