NexusFi: Find Your Edge


Home Menu

 





New Optimization Types


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one eleven with 7 posts (49 thanks)
    2. looks_two Big Mike with 2 posts (2 thanks)
    3. looks_3 adrianjm with 1 posts (0 thanks)
    4. looks_4 sajosh with 1 posts (1 thanks)
      Best Posters
    1. looks_one eleven with 7 thanks per post
    2. looks_two Big Mike with 1 thanks per post
    3. looks_3 kirkhammett with 1 thanks per post
    4. looks_4 sajosh with 1 thanks per post
    1. trending_up 6,915 views
    2. thumb_up 53 thanks given
    3. group 10 followers
    1. forum 12 posts
    2. attach_file 9 attachments




 
Search this Thread

New Optimization Types

  #1 (permalink)
 eleven 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Kinetick
Trading: Currency Futures
Posts: 41 since Jul 2009
Thanks Given: 19
Thanks Received: 91

Often, I found that I'd rather modify the NT strategy analyzer optimizer type rather than my strategy that I developed. This is one such strategy optimizer type that I wrote. It is similar to the linear rsquared trendline function in MS excel. This optimization will maximize the linearity of the equity curve.

Enjoy,
eleven

Attached Files
Elite Membership required to download: eleRSquared.cs
Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Trade idea based off three indicators.
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Tao te Trade: way of the WLD
24 thanks
Diary of a simple price action trader
20 thanks
My NQ Trading Journal
14 thanks
GFIs1 1 DAX trade per day journal
9 thanks
  #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,440 since Jun 2009
Thanks Given: 33,207
Thanks Received: 101,599


eleven View Post
Often, I found that I'd rather modify the NT strategy analyzer optimizer type rather than my strategy that I developed. This is one such strategy optimizer type that I wrote. It is similar to the linear rsquared trendline function in MS excel. This optimization will maximize the linearity of the equity curve.

Enjoy,
eleven

Cool - for those of us who are math challenged, can you give some more details as to how this is being accomplished?

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
  #3 (permalink)
 eleven 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Kinetick
Trading: Currency Futures
Posts: 41 since Jul 2009
Thanks Given: 19
Thanks Received: 91


RSquared is the coefficient of determination.

The optimization performs simple linear regression of the equity curve by the least squares method to determine slope of a linear line. This linear regression line is then correlated with the equity curve by trade # to calculate r-squared. The closer to 1 the better the fit. I have wrote the code to only return result with positive net income. I have provided an updated attachment that removes some redundant code.

I have pulled the following definition from Investopedia which provides a very good explanation.

What Does Coefficient of Determination Mean?
A measure used in statistical model analysis to assess how well a model explains and predicts future outcomes. It is indicative of the level of explained variablity in the model. The coefficient, also commonly known as R-square, is used as a guideline to measure the accuracy of the model.

Investopedia explains Coefficient of Determination

One use of the coefficient of determination is to test the goodness of fit of the model. It is expressed as a value between zero and one. A value of one indicates a perfect fit, and therefore, a very reliable model for future forecasts. A value of zero, on the other hand, would indicate that the model fails to accurately model the dataset.


Attached Files
Elite Membership required to download: eleRSquared.cs
Started this thread Reply With Quote
  #4 (permalink)
 eleven 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Kinetick
Trading: Currency Futures
Posts: 41 since Jul 2009
Thanks Given: 19
Thanks Received: 91

Revision 0.12 - Uploaded 11/10/2011 to download section: Fixed error in calculation

Update attached in this post

Attached Files
Elite Membership required to download: eleRSquared.cs
Started this thread Reply With Quote
  #5 (permalink)
 eleven 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Kinetick
Trading: Currency Futures
Posts: 41 since Jul 2009
Thanks Given: 19
Thanks Received: 91

Here is an optimization type: (R^2)(net profit).

Attached Files
Elite Membership required to download: eleRSquaredXnetProf.cs
Started this thread Reply With Quote
  #6 (permalink)
 eleven 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Kinetick
Trading: Currency Futures
Posts: 41 since Jul 2009
Thanks Given: 19
Thanks Received: 91

Here is an optimization type: (Sharpe Ratio)(Net Profit).

Attached Files
Elite Membership required to download: eleSharpeRatioXnetProf.cs
Started this thread Reply With Quote
  #7 (permalink)
BrianH
Austin Texas
 
Posts: 7 since Jun 2013
Thanks Given: 5
Thanks Received: 1

Thanks for sharing this. I was looking for something like this on the Ninja board and Bertrand suggested I look at this. I would like to optimize based on the profit curve being as close as possible to a straight line. I assume that is what your download in the previous post with R2 does -- correct? What is the difference with the next download? Does it still look at the equity curve or only at Sharp and Net Profit?

Reply With Quote
  #8 (permalink)
adrianjm
Waterford, Ireland
 
Posts: 15 since Dec 2011
Thanks Given: 22
Thanks Received: 12

Such a newby question, but how do I incorporate this into my optimisation? Currently I can only see the 'default' and 'Genetic', and the default options for 'optimize on'.

Be great to be able to incorporate this into some of my strategies!

Thanks!

Edit: I just had the option show up in 'optimize on' list. Awesome, thank you.

Reply With Quote
  #9 (permalink)
 eleven 
California, USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Kinetick
Trading: Currency Futures
Posts: 41 since Jul 2009
Thanks Given: 19
Thanks Received: 91

Here is another optimization type: Zephyr K-Ratio by Zephry and Associates. Information is in public domain. See link to understand.

Zephyr K-Ratio | Zephyr Associates, Inc

Attached Files
Elite Membership required to download: eleZephyrKRatio.cs
Started this thread Reply With Quote
  #10 (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,440 since Jun 2009
Thanks Given: 33,207
Thanks Received: 101,599


This thread has most of them:



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:




Last Updated on August 22, 2019


© 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