NexusFi: Find Your Edge


Home Menu

 





System Optimization Fitness Functions


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one fluxsmith with 7 posts (11 thanks)
    2. looks_two Trader.Jon with 4 posts (1 thanks)
    3. looks_3 gordo with 3 posts (5 thanks)
    4. looks_4 baruchs with 2 posts (3 thanks)
      Best Posters
    1. looks_one pakricard with 2 thanks per post
    2. looks_two gordo with 1.7 thanks per post
    3. looks_3 fluxsmith with 1.6 thanks per post
    4. looks_4 baruchs with 1.5 thanks per post
    1. trending_up 16,065 views
    2. thumb_up 27 thanks given
    3. group 10 followers
    1. forum 27 posts
    2. attach_file 4 attachments




 
Search this Thread

System Optimization Fitness Functions

  #21 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
Posts: 290 since May 2010
Thanks Given: 97
Thanks Received: 322


pakricard View Post
...Also has anyone worked on Expectancy score optimization ?

I can't really justify any of this scientifically (I'm not much of a mathametician), but I prefer my SQN performance function for choosing parameters. I then use expectancy for ranking my many system attempts to decide which ones to deploy my limited capital on. Actually I rank by sharpe ratio x expectancy. I figure by doing so I'm preferring both high expectancy and consistency.

Visit my NexusFi Trade Journal Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
MC PL editor upgrade
MultiCharts
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
Better Renko Gaps
The Elite Circle
How to apply profiles
Traders Hideout
 
  #22 (permalink)
 mainstream 
Chicago, IL
 
Experience: Master
Platform: Kinetick Ninja Trader <7>
Broker: Ninja & IB
Trading: YM & Equities & Options & Mutual Funds
Posts: 174 since Jun 2010
Thanks Given: 57
Thanks Received: 88

This is an interesting thread. If I understand these posts, what was coded can been seen when analyzing the chart after the optimization, or walk forward, or back test for that matter.

If the trade looks to good to be true on the chart, then it likely would not occur in a live environment. After an optimization or back test or walk forward, I am always studying the chart to see if the numbers are real or just the way the bars plot outside of the live environment.

RE Win/Loss, what about a trailing stop? You could have a winner but not a winner according to your parameters, and with a health risk reward anything over 50% is pretty darn good.

What is particular interesting to me is the max consecutive losers and biggest loosing trade.... How much pain can you take before you're tempted to switch things up in a live environment.

I am looking forward to examining you're optimization code, thanks for sharing.

Reply With Quote
  #23 (permalink)
 
gordo's Avatar
 gordo 
Tonganoxie, Kansas
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: CL,6E
Posts: 160 since Nov 2009
Thanks Given: 129
Thanks Received: 401


Hi guys,

How do I get the downloaded OptimizerType files to show up in the drop down menu? I copied the file into NinjaTrader7/bin/Custom/Type...now what???

Thanks,
Gordo

Visit my NexusFi Trade Journal Reply With Quote
  #24 (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,658


gordo View Post
Hi guys,

How do I get the downloaded OptimizerType files to show up in the drop down menu? I copied the file into NinjaTrader7/bin/Custom/Type...now what???

Thanks,
Gordo

Restart Ninja.

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:
  #25 (permalink)
 pakricard 
Indonesia
 
Experience: Beginner
Platform: NT
Trading: FDAX
Posts: 29 since Jan 2011
Thanks Given: 13
Thanks Received: 18


gordo View Post
Hi guys,

How do I get the downloaded OptimizerType files to show up in the drop down menu? I copied the file into NinjaTrader7/bin/Custom/Type...now what???

Thanks,
Gordo

Also, you need to recompile any strategy, so NT will compile the new optimizer type.

Reply With Quote
Thanked by:
  #26 (permalink)
kk240
Europe,Nomad
 
Posts: 84 since Nov 2010
Thanks Given: 25
Thanks Received: 30

Here is link how to calculate Wealth Lab Score, how they rank systems
Top 25 ChartScripts Update Utility

I tried once to code, it. but not had enough experience tweak ninja. It should be possible to code. I found all values.
I try to find my code, if somebody else want try to code it.

Reply With Quote
  #27 (permalink)
 
gordo's Avatar
 gordo 
Tonganoxie, Kansas
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: CL,6E
Posts: 160 since Nov 2009
Thanks Given: 129
Thanks Received: 401


pakricard View Post
...has anyone worked on Expectancy score optimization ?

Funny you should ask. I went through the nexusfi.com (formerly BMT) threads and did not find anyone who had comleted the work identified in your link. I think there is another nice link here in nexusfi.com (formerly BMT) that goes along with this discussion that is a bit older, but still relevant to this discussion:



@ caprica did most of the work, but did not deal with the non-scratch (break-even) trades. I took a stab at it and put it in the downloads:



I borrowed a lot of the work from @ caprica and then took the formulas from Unicorn Research to build the optimizer. Here are the formulas from Unicorn:

Expectancy is how much you expect to earn from each trade for every dollar you risk. Opportunity is how often your strategy trades. You want to maximize the product of both.
Expectancy = (AW × PW + AL × PL) ⁄ |AL| (expected profit per dollar risked)
Expectancy score = Expectancy × Opportunity
where AW = average winning trade (excluding maximum win) PW = probability of winning (PW = <wins> ⁄ NST


where <wins> is total wins excluding maximum win) AL = average losing trade (negative, excluding scratch losses) |AL| = absolute value of AL PL = probability of losing (PL = <non-scratch losses> ⁄ NST) Opportunity = NST × 365 ⁄ studydays (opportunities to trade in a year) where
  • NST = <total trades> − <scratch trades> − 1
    In other words, NST = non-scratch trades during the period under test (a scratch trade loses commission+slippage or less) minus 1 (to exclude the maximum win).
  • studydays = calendar days of history being tested
Hope you guys enjoy and I am looking for feedback and improvement ideas.

Gordo

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #28 (permalink)
 
gordo's Avatar
 gordo 
Tonganoxie, Kansas
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: CL,6E
Posts: 160 since Nov 2009
Thanks Given: 129
Thanks Received: 401

So I built this Expectancy Score optimization (prior post) and I get some values (see attached). Now I ask, which is best? You can sort each column and come up with a different answer for that question depending on which column you pick. But how do you combine all the columns together (becasuse they are all important) and come up with a 'BEST'?

Multiply them together? Calculate a Bayesian inference? Least squares? Pythogrium therom? Pick a number between 1 and 10?

Remember, inside an optimization, you can only look at one row at a time and give that row a value. Then the optimizer picks the top values for your consideration. I am not a mathmetician, but it just seems to me it can be done mathmatically. Anybody got any ideas?

Tell you what. You come up with the idea and I will put it in an optimization and share. Deal?

Help an old guy out here, would yah?

Attached Thumbnails
Click image for larger version

Name:	NinjaTrader Grid 4_29_2011 5_21 PM.png
Views:	376
Size:	30.5 KB
ID:	37636  
Attached Files
Elite Membership required to download: NinjaTrader Grid 4_29_2011 5_21 PM.xls
Visit my NexusFi Trade Journal Reply With Quote




Last Updated on April 29, 2011


© 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