System Optimization Fitness Functions - futures io
futures io



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 (2 thanks)
      Best Posters
    1. looks_one gordo with 1.7 thanks per post
    2. looks_two fluxsmith with 1.6 thanks per post
    3. looks_3 pakricard with 1.5 thanks per post
    4. looks_4 baruchs with 1 thanks per post
    1. trending_up 12,036 views
    2. thumb_up 25 thanks given
    3. group 10 followers
    1. forum 27 posts
    2. attach_file 4 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • 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 and simple.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

 
Search this Thread
 

System Optimization Fitness Functions

(login for full post details)
  #1 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received

My hope in starting this thread is that others will share their preferred fitness functions, that together we may come up with a better function. I know Big Mike has one I've never seen posted (hint), hopefully others also have ideas we can share in this area.

Here is mine at the moment (NT7), I would characterize it as a conservative variant of Van Tharp's System Quality Number:
 
Code
public override double GetPerformanceValue(SystemPerformance systemPerformance)
{
 // Normalize number of trades to one year
 int numTradesYear = (int)(systemPerformance.AllTrades.TradesPerformance.TradesPerDay * 365.0);
 
 
 // If it doesn't even trade once a week it isn't interesting to me
 if ( numTradesYear < 50 )
    return double.MinValue;
 
 
 // If it hasn't ever lost it is either unrealistic or doesn't have enough samples
 if ( systemPerformance.AllTrades.LosingTrades.Count == 0 )
    return double.MinValue;
 
 
 // Determine average profit with best outlier removed
 int numTrades = systemPerformance.AllTrades.Count - 1;
 double avgProfit = (systemPerformance.AllTrades.TradesPerformance.Currency.CumProfit - systemPerformance.AllTrades.TradesPerformance.Currency.LargestWinner) / numTrades;
 
 return Math.Sqrt(numTradesYear) * avgProfit / Math.Max(systemPerformance.AllTrades.TradesPerformance.Currency.StdDev, avgProfit * .20);
}

Visit my futures io Trade Journal Started this thread Reply With Quote
The following 2 users say Thank You to fluxsmith for this post:

Journal Challenge April 2021 results:
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(618 thanks from 61 posts)
looks_twoSalao's Journalby Salao
(160 thanks from 29 posts)
looks_3Learning to Profit - A journey in algorithms and optionsby Syntax
(115 thanks from 27 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(94 thanks from 30 posts)
looks_5Maybe a little bit different journalby Malykubo
(53 thanks from 32 posts)
 
Best Threads (Most Thanked)
in the last 7 days on futures io
I finally blew up an account
234 thanks
The Crude Dude Oil Trading System
83 thanks
Spoo-nalysis ES e-mini futures S&P 500
65 thanks
The tiyfTradePlanFactory indicator
31 thanks
Building a Crypto Mining Rig
19 thanks
 
(login for full post details)
  #3 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
 
Posts: 323 since Jun 2009
Thanks: 6 given, 208 received


Hi,
I don't know if there is something called the best "fitness function".
The fitness function that I use gives the best results for the tested data.
It is - Net Profit divided by minus Draw Down. This gives you the best result PERIOD!
But what we are looking for is not the best result for the tested data, but the better predictor for future data.
As I always say optimization is worthless. The only allowed action is walk forward.

Baruch

Reply With Quote
The following 2 users say Thank You to baruchs for this post:
 
(login for full post details)
  #4 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received


baruchs View Post
...Net Profit divided by minus Draw Down. This gives you the best result PERIOD!...

Thank you for responding. In my function I found if I don't impute some variance it greatly favored parameters that claim little or no variance (or drawdown), but only take a couple of ticks per trade. I can imagine the same problem with drawdown as a divisor, do you impute a threshold level of drawdown in your calculation?

Visit my futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
 baruchs 
Israel
 
Experience: Intermediate
Platform: NinjaTrader
Broker: pfg
Trading: eminis
 
Posts: 323 since Jun 2009
Thanks: 6 given, 208 received

No I don't.
If you find a setup with Zero draw down you found a holy grail!!
Comparing two setups the best is with higher NP/DD

Baruch

Reply With Quote
 
(login for full post details)
  #6 (permalink)
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 184 received


baruchs View Post
Hi,
I don't know if there is something called the best "fitness function".
The fitness function that I use gives the best results for the tested data.
It is - Net Profit divided by minus Draw Down. This gives you the best result PERIOD!
But what we are looking for is not the best result for the tested data, but the better predictor for future data.
As I always say optimization is worthless. The only allowed action is walk forward.

Baruch

I have a high degree of agreement with the walk forward. My gut feeling there is to do a default opt on a challenging month (ie periods of both high and low volatility, both bulls and bears getting greedy, and then use the best results are midpoints for the genetic optimization walk forward: 7 days test 1 day walk and then repeat.

Can you post your 'fitness function'? It would be very helpful to me to see the actual code.

TIA!
Jon

Reply With Quote
 
(login for full post details)
  #7 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received

I'm still trying to find the ideal fitness function. Net Profit / Drawdown as suggested here previously doesn't do it for me, as that ignores consistency and unrealized risk. The attached is the best I've come up with so far. For me the goal is to have a function that will sort to the top the same parameters I would select by hand based on visual analysis of the cumulative profit graph, which ideally would be a smooth progression from bottom left to top right; and when otherwise comparable preferring the smallest stops.

Attached Files
Register to download File Type: cs Quality3.cs (2.8 KB, 205 views)
Visit my futures io Trade Journal Started this thread Reply With Quote
The following 3 users say Thank You to fluxsmith for this post:
 
(login for full post details)
  #8 (permalink)
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 184 received


fluxsmith View Post
I'm still trying to find the ideal fitness function. Net Profit / Drawdown as suggested here previously doesn't do it for me, as that ignores consistency and unrealized risk. The attached is the best I've come up with so far. For me the goal is to have a function that will sort to the top the same parameters I would select by hand based on visual analysis of the cumulative profit graph, which ideally would be a smooth progression from bottom left to top right; and when otherwise comparable preferring the smallest stops.

fluxsmith,

I very much appreciate the analysis, and your sharing it with us ... I am a believer in removing those pesky outliers, as you have done in your code, and that leaves me confused as to the reasons for the different values used in the multiples (*.20 vs. *.382 ,to me, is huge for 1 trade difference). I am sure there is a good reasom, that is why I am asking to be educated, and as it wasnt included in the .cs :

.... this from Quality3.cs ... (.382)
// Determine average adusted profit
int numTrades = systemPerformance.AllTrades.Count;
double avgProfit = profit / numTrades;

return Math.Sqrt(numTradesYear) * avgProfit / Math.Max(systemPerformance.AllTrades.TradesPerformance.Currency.StdDev, avgProfit * .382);

compared to the original post ... (.20)
// Determine average profit with best outlier removed
int numTrades = systemPerformance.AllTrades.Count - 1;
double avgProfit = (systemPerformance.AllTrades.TradesPerformance.Currency.CumProfit - systemPerformance.AllTrades.TradesPerformance.Currency.LargestWinner) / numTrades;

return Math.Sqrt(numTradesYear) * avgProfit / Math.Max(systemPerformance.AllTrades.TradesPerformance.Currency.StdDev, avgProfit * .20);

TIA!
Jon

Reply With Quote
 
(login for full post details)
  #9 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received

Experimentally I found .20 wasn't high enough, I settled on .382 as being representative of one standard deviation. What I'm doing there is imputing a minimum variance I'll accept for use in the calculation. Without that I found it gave too much preference to parameters that had low deviation only because they had minimal profit targets.

Visit my futures io Trade Journal Started this thread Reply With Quote
The following user says Thank You to fluxsmith for this post:
 
(login for full post details)
  #10 (permalink)
 flyscalper 
Barcelona, Spain
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: Futures
 
Posts: 24 since Jul 2009
Thanks: 35 given, 7 received


Hello,

I would like to get an optimization type as a Calmar Ratio: Annual Profit / DD max, but the problem is that I do not know how to compute the Annual Profit with the systemPerformance variables.

Un saludo,

Pablo

Reply With Quote
 
(login for full post details)
  #11 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received


flyscalper View Post
I would like to get an optimization type as a Calmar Ratio: Annual Profit / DD max...

For annual profit I would suggest systemPerformance.AllTrades.TradesPerformance.TradesPerDay * 365 * systemPerformance.AllTrades.TradesPerformance.Currency.CumProfit / systemPerformance.AllTrades.Count

(There may be better ways, that's without pulling up documentation or intellisense)

Visit my futures io Trade Journal Started this thread Reply With Quote
The following user says Thank You to fluxsmith for this post:
 
(login for full post details)
  #12 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
 
Posts: 57 since Aug 2010
Thanks: 6 given, 73 received

Store the date of the first and last trades as follows:

 
Code
 DateTime start = new DateTime();
            DateTime stop = new DateTime();
            bool init = false;

            foreach (Trade t in systemPerformance.AllTrades.LosingTrades)
            {
                if (!init)
                {
                    init = true;
                    start = t.Entry.Time.Date;
                }
                stop = t.Entry.Time.Date;
                
            }
Then you can determine Annual Profits as (systemPerformance.AllTrades.TradesPerformance.GrossProfit + systemPerformance.AllTrades.TradesPerformance.GrossLoss) / number of years;


flyscalper View Post
Hello,

I would like to get an optimization type as a Calmar Ratio: Annual Profit / DD max, but the problem is that I do not know how to compute the Annual Profit with the systemPerformance variables.

Un saludo,

Pablo


Follow me on Twitter Reply With Quote
The following user says Thank You to MooreTech for this post:
 
(login for full post details)
  #13 (permalink)
 flyscalper 
Barcelona, Spain
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: Futures
 
Posts: 24 since Jul 2009
Thanks: 35 given, 7 received

Hi guys,

thank you for the suggestions. I will try it very soon. MooreTech, your approach is a little more complicated than the fluxsmith's one. Don't you think it is possible to calculate the way he says?

Un saludo,

Pablo

Reply With Quote
 
(login for full post details)
  #14 (permalink)
 MooreTech 
Orlando, Florida
 
Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Trading: ES
 
Posts: 57 since Aug 2010
Thanks: 6 given, 73 received

Yes I believe his is a simpler approach. Didn't see his answer before I posted.



flyscalper View Post
Hi guys,

thank you for the suggestions. I will try it very soon. MooreTech, your approach is a little more complicated than the fluxsmith's one. Don't you think it is possible to calculate the way he says?

Un saludo,

Pablo


Follow me on Twitter Reply With Quote
 
(login for full post details)
  #15 (permalink)
 bizman70 
toronto, ontario
 
Experience: Intermediate
Platform: ninja trader
Broker: sterling, iqfeed
Trading: es, nq, 6e
 
bizman70's Avatar
 
Posts: 363 since May 2010
Thanks: 41 given, 140 received

we found that using a total of 10000 totals works well - ie - 50 generations with 200 populations -



MooreTech View Post
Yes I believe his is a simpler approach. Didn't see his answer before I posted.


Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #16 (permalink)
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 184 received


fluxsmith View Post
I'm still trying to find the ideal fitness function. Net Profit / Drawdown as suggested here previously doesn't do it for me, as that ignores consistency and unrealized risk. The attached is the best I've come up with so far. For me the goal is to have a function that will sort to the top the same parameters I would select by hand based on visual analysis of the cumulative profit graph, which ideally would be a smooth progression from bottom left to top right; and when otherwise comparable preferring the smallest stops.

fluxsmith,

Sometimes I wonder if I go in circles, then I realize I haven't, which then makes me wonder even more .. I was using various 'optimization functions' available to NT7, and after a long day and night of jumping from one machine to another VM and back again (and seeing the same results too many times) I thought for sure I was ready for sleep so I did ... in the morning the results were still there ... blessed be: your Quality3.cs is giving me the same results, both on variables inputs AND $$/trades summary that the SQN.cs ( ) is producing ...
the only diff is the very nice 'performance' rating supplied by your code (4+ rating in a test of a long only strategy in a period of choppy bearish action)

now I dont know if I should be

or
or
or

Any thoughts ? I KNOW the code is different, just wondering if you had noticed the parallel results?

Jon

Reply With Quote
The following user says Thank You to Trader.Jon for this post:
 
(login for full post details)
  #17 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received


Trader.Jon View Post
...Any thoughts ? I KNOW the code is different [vs SQN.cs], just wondering if you had noticed the parallel results?

They're based on the same principle, so they would often return the same scoring order of parameters. Mine does try to make some adjustments for conservatism, and annualizes the score, which is why on a backtest over less than a year you'll see higher scores on mine (and lower scores on a backtest over more than a year).

Visit my futures io Trade Journal Started this thread Reply With Quote
The following 4 users say Thank You to fluxsmith for this post:
 
(login for full post details)
  #18 (permalink)
 bizman70 
toronto, ontario
 
Experience: Intermediate
Platform: ninja trader
Broker: sterling, iqfeed
Trading: es, nq, 6e
 
bizman70's Avatar
 
Posts: 363 since May 2010
Thanks: 41 given, 140 received

why would it work better to try to backtest and optimize on a very long time frame - markets change all the time - i find that when i backtest for about 60-90 days and walkforward about 30 days it gives pretty good results overall for the next week or so to live run -
what i am still having a difficult time with is finding the right parameter set count - where a function or system will automaticlly calculate the population number and iterations it needs based on the parameter set count

Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #19 (permalink)
 Trader.Jon 
Near the BEuTiFULL Horse Shoe
 
Experience: Beginner
Platform: NinjaTrader
Broker: MBTrading Dukascopy ZenFire
Trading: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 184 received


bizman70 View Post
why would it work better to try to backtest and optimize on a very long time frame - markets change all the time - i find that when i backtest for about 60-90 days and walkforward about 30 days it gives pretty good results overall for the next week or so to live run -
what i am still having a difficult time with is finding the right parameter set count - where a function or system will automaticlly calculate the population number and iterations it needs based on the parameter set count

I look at markets as having different personalities when they are bullish or bearish, so different parameters or even different straegies may have to be used.

Personally, I feel that it is better to optimize on the most demanding conditions: currently I am working on LONG ONLY(testing in choppy bearish time period) and SHORT ONLY(testing in choppy bullish time period) testing of strategies.

TJ

Reply With Quote
 
(login for full post details)
  #20 (permalink)
 pakricard 
Indonesia
 
Experience: Beginner
Platform: NT
Trading: FDAX
 
Posts: 29 since Jan 2011
Thanks: 13 given, 17 received

Before reading this thread I thought the GOOD strategy should have:

- Good profits
- Good win/loss ratio
- Few number of trades

And until now I have been using the attached code.

After reading this thread I've seen I've been simplystic, so I'll use some of your ideas. Also has anyone worked on Expectancy score optimization ?

Attached Files
Register to download File Type: cs MaxSB.cs (1.3 KB, 77 views)
Reply With Quote
The following 2 users say Thank You to pakricard for this post:
 
(login for full post details)
  #21 (permalink)
 fluxsmith 
Santa Maria
 
Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker: Mirus/Zen-Fire
Trading: ES
 
Posts: 295 since May 2010
Thanks: 97 given, 322 received


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 futures io Trade Journal Started this thread Reply With Quote
 
(login for full post details)
  #22 (permalink)
 mainstream 
Chicago, IL
 
Experience: Master
Platform: Kinetick Ninja Trader <7>
Broker: Ninja & IB
Trading: YM & Equities & Options & Mutual Funds
 
Posts: 175 since Jun 2010
Thanks: 56 given, 87 received

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
 
(login for full post details)
  #23 (permalink)
 gordo 
Tonganoxie, Kansas
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: CL,6E
 
gordo's Avatar
 
Posts: 160 since Nov 2009
Thanks: 129 given, 400 received

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 futures io Trade Journal Reply With Quote
 
(login for full post details)
  #24 (permalink)
 Big Mike 
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: Custom solution
Trading: Futures & Crypto
 
Big Mike's Avatar
 
Posts: 50,068 since Jun 2009
Thanks: 32,534 given, 98,493 received


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

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/

Visit other sites? Please spread the word about your experience with our community!
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to Big Mike for this post:
 
(login for full post details)
  #25 (permalink)
 pakricard 
Indonesia
 
Experience: Beginner
Platform: NT
Trading: FDAX
 
Posts: 29 since Jan 2011
Thanks: 13 given, 17 received


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
The following user says Thank You to pakricard for this post:
 
(login for full post details)
  #26 (permalink)
kk240
Europe,Nomad
 
 
Posts: 85 since Nov 2010
Thanks: 25 given, 30 received

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
 
(login for full post details)
  #27 (permalink)
 gordo 
Tonganoxie, Kansas
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: CL,6E
 
gordo's Avatar
 
Posts: 160 since Nov 2009
Thanks: 129 given, 400 received


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

Funny you should ask. I went through the futures.io (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 futures.io (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 futures io Trade Journal Reply With Quote
The following 2 users say Thank You to gordo for this post:
 
(login for full post details)
  #28 (permalink)
 gordo 
Tonganoxie, Kansas
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Mirus Futures/Zen-Fire
Trading: CL,6E
 
gordo's Avatar
 
Posts: 160 since Nov 2009
Thanks: 129 given, 400 received

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:	207
Size:	30.5 KB
ID:	37636  
Attached Files
Register to download File Type: xls NinjaTrader Grid 4_29_2011 5_21 PM.xls (20.5 KB, 43 views)
Visit my futures io Trade Journal Reply With Quote
The following 3 users say Thank You to gordo for this post:


futures io Trading Community Platforms and Indicators NinjaTrader > System Optimization Fitness Functions


Last Updated on April 29, 2011


Upcoming Webinars and Events

NinjaTrader Indicator Challenge!

Ongoing

Journal Challenge w/$1,800 in prizes!

May 7

The Cold Hard Truth: Maybe I Am Not Good Enough w/Chris Gray @ Earn2Trade

Elite only
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada), info@futures.io
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.
no new posts