System Optimization Fitness Functions - NinjaTrader Programming | futures io social day trading
futures io futures trading


System Optimization Fitness Functions
Updated: Views / Replies:9,083 / 27
Created: by fluxsmith Attachments:4

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

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

Reply
 4  
 
Thread Tools Search this Thread
 

System Optimization Fitness Functions

  #11 (permalink)
Elite Member
Santa Maria
 
Futures Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker/Data: Mirus/Zen-Fire
Favorite Futures: ES
 
Posts: 295 since May 2010
Thanks: 101 given, 320 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)

Reply With Quote
The following user says Thank You to fluxsmith for this post:
 
  #12 (permalink)
Elite Member
Orlando, Florida
 
Futures Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Favorite Futures: ES
 
Posts: 56 since Aug 2010
Thanks: 3 given, 66 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


Reply With Quote
The following user says Thank You to MooreTech for this post:
 
  #13 (permalink)
Elite Member
Barcelona, Spain
 
Futures Experience: Intermediate
Platform: NinjaTrader
Broker/Data: Mirus Futures/Zen-Fire
Favorite Futures: Futures
 
Posts: 24 since Jul 2009
Thanks: 35 given, 7 received

Thank you both


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
 
  #14 (permalink)
Elite Member
Orlando, Florida
 
Futures Experience: Advanced
Platform: NinjaTrader, TradeStation, MultiCharts, eSignal, MetaTrader
Favorite Futures: ES
 
Posts: 56 since Aug 2010
Thanks: 3 given, 66 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


Reply With Quote
 
  #15 (permalink)
Elite Member
toronto, ontario
 
Futures Experience: Intermediate
Platform: ninja trader
Broker/Data: sterling, iqfeed
Favorite Futures: es, nq, 6e
 
bizman70's Avatar
 
Posts: 363 since May 2010
Thanks: 41 given, 140 received

particle swarm

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.


Reply With Quote
 
  #16 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 received

questions and thoughts and analysis and .. and ..


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 ( https://futures.io/free_downloads/ninjatrader/strategies/99-download.html?action=jump ) 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:
 
  #17 (permalink)
Elite Member
Santa Maria
 
Futures Experience: Advanced
Platform: NinjaTrader, ThinkOrSwim
Broker/Data: Mirus/Zen-Fire
Favorite Futures: ES
 
Posts: 295 since May 2010
Thanks: 101 given, 320 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).

Reply With Quote
The following 4 users say Thank You to fluxsmith for this post:
 
  #18 (permalink)
Elite Member
toronto, ontario
 
Futures Experience: Intermediate
Platform: ninja trader
Broker/Data: sterling, iqfeed
Favorite Futures: es, nq, 6e
 
bizman70's Avatar
 
Posts: 363 since May 2010
Thanks: 41 given, 140 received

optimizer

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

Reply With Quote
 
  #19 (permalink)
Elite Member
Near the BEuTiFULL Horse Shoe
 
Futures Experience: Beginner
Platform: NinjaTrader
Broker/Data: MBTrading Dukascopy ZenFire
Favorite Futures: $EURUSD when it is trending
 
Trader.Jon's Avatar
 
Posts: 500 since Jul 2009
Thanks: 401 given, 176 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
 
  #20 (permalink)
Elite Member
Indonesia
 
Futures Experience: Beginner
Platform: NT
Favorite Futures: 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, 68 views)
Reply With Quote
The following 2 users say Thank You to pakricard for this post:

Reply



futures io > > > > > System Optimization Fitness Functions

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with ADXVMA Optimization hunter548 NinjaTrader Programming 3 July 31st, 2011 04:49 PM
Expectancy custom fitness sam028 EasyLanguage Programming 13 September 29th, 2010 10:23 PM
Strategy Fitness Test Zach b NinjaTrader Programming 17 April 30th, 2010 12:04 AM
Music + neuronal functions max-td Traders Hideout 0 October 12th, 2009 10:04 AM


All times are GMT -4. The time now is 09:34 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, 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
Page generated 2017-12-12 in 0.15 seconds with 20 queries on phoenix via your IP 54.221.93.187