Expectancy custom fitness - futures io
futures io futures trading



Expectancy custom fitness


Discussion in EasyLanguage Programming

Updated by zerobot007
      Top Posters
    1. looks_one Big Mike with 7 posts (0 thanks)
    2. looks_two sam028 with 4 posts (4 thanks)
    3. looks_3 aslan with 1 posts (0 thanks)
    4. looks_4 zerobot007 with 1 posts (2 thanks)
    1. trending_up 6,391 views
    2. thumb_up 6 thanks given
    3. group 4 followers
    1. forum 13 replies
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

Expectancy custom fitness

(login for full post details)
  #1 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,759 given, 4,438 received

A custom criteria for MC optimization, the expectancy:

 
Code
                            
if ( StrategyPerformance.TotalTrades.Count == || StrategyPerformance.LosingTrades.Count== ) {

  return 
0;
}

return  (
StrategyPerformance.PercentProfitable*StrategyPerformance.AvgWinningTrade StrategyPerformance.WinningTrades*StrategyPerformance.AvgLosingTrade); 
It might be good to be able to optimize a strategy parameters with a Sharpe ratio, as this ratio is already known by MC, but I haven't already found if it's possible or not...

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following 2 users say Thank You to sam028 for this post:

Can you help answer these questions
from other members on futures io?
Need a near crosses scan help for TOS
ThinkOrSwim
Where is the link to download GomiRecorder?
NinjaTrader
Horizontal Line Indicator
Platforms and Indicators
OPEN_CLOSE_DOTS
ThinkOrSwim
Webinar: Linda Bradford Raschke Dealing with August burnout and Trader Camaraderie
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Fundamental question on index trading
21 thanks
Excited and scared at the same time
13 thanks
Advice for best # of Ticks to set charts to for MES or MNQ ?
11 thanks
Is Orderflow An Outdated Concept?
11 thanks
https://ivytrusts.com/ SCAM ALERT
9 thanks
 
(login for full post details)
  #3 (permalink)
Madison, WI
 
Experience: Advanced
Platform: Sierra Charts, ALT
Trading: ES
 
aslan's Avatar
 
Posts: 616 since Jan 2010
Thanks: 351 given, 1,107 received


I have not done any custom criteria, would you mind explaining how to use that in MC?

Reply With Quote
 
(login for full post details)
  #4 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,759 given, 4,438 received

Check screenshot below.



There is 18 standard criterias (Net profit, %Profitable, ...), but you can also define yours.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #5 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,052 since Jun 2009
Thanks: 31,658 given, 94,944 received

Awesome, thx Sam - I needed this

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/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #6 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,052 since Jun 2009
Thanks: 31,658 given, 94,944 received

Hmm, Sam I had problems with your code.

I define expectancy like this:

((avgWinningDollar * pctWinners) - (avgLosingDollar * pctLosers)) / avgLosingDollar



A real world example:

avgWinningDollar = 405.88
pctWinners = 43.59%
avgLosingDollar = 209.39
pctLosers = 56.41%

The result should be:
(405.88 * 0.4359) - (209.39 * 0.5641) / 209.39

Which gives us:
0.28, a very low and poor expectancy (1.0 or above is desired).

Since my code is dramatically different than yours, I'm including it here. Thanks for forcing me to take the time to do it - needed to be done!

 
Code
                            
// Expectancy
if ( StrategyPerformance.TotalTrades.Count == || StrategyPerformance.LosingTrades.Count== ) {
  return 
0;
}

// (avgWinDollar * pctWin + avgLoseDollar * pctLose) / Abs(avgLoseDollar)
return ((StrategyPerformance.AvgWinningTrade * (StrategyPerformance.PercentProfitable 100)) + (StrategyPerformance.AvgLosingTrade * (- (StrategyPerformance.PercentProfitable 100)))) / -StrategyPerformance.AvgLosingTrade;; 
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/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #7 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,052 since Jun 2009
Thanks: 31,658 given, 94,944 received

Hmm, here is another update. Seems I needed to check for some more division by zero.

 
Code
                            
// Expectancy
if ( StrategyPerformance.TotalTrades.Count == || StrategyPerformance.LosingTrades.Count== || StrategyPerformance.PercentProfitable == || StrategyPerformance.PercentProfitable == 100 || StrategyPerformance.AvgWinningTrade == || StrategyPerformance.AvgLosingTrade == ) {
  return 
0;
}

// ((avgWinDollar * pctWin) + (avgLoseDollar * pctLose) / Abs(avgLoseDollar)
return ((StrategyPerformance.AvgWinningTrade * (StrategyPerformance.PercentProfitable 100)) + (StrategyPerformance.AvgLosingTrade * (- (StrategyPerformance.PercentProfitable 100)))) / -StrategyPerformance.AvgLosingTrade
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/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #8 (permalink)
Site Moderator
 
 
sam028's Avatar
 
Posts: 3,635 since Jun 2009
Thanks: 3,759 given, 4,438 received

Hmm, for me it's:
Expectancy = (Probability of Win * Average Win) - (Probability of Loss * Average Loss)
, and the higher the better.
But I'll check this, I'm maybe wrong.

There is a post on this here.

Success requires no deodorant! (Sun Tzu)
Follow me on Twitter Reply With Quote
The following user says Thank You to sam028 for this post:
 
(login for full post details)
  #9 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,052 since Jun 2009
Thanks: 31,658 given, 94,944 received


sam028 View Post
Hmm, for me it's:
Expectancy = (Probability of Win * Average Win) - (Probability of Loss * Average Loss)
, and the higher the better.
But I'll check this, I'm maybe wrong.

There is a post on this here.

Hi Sam,

That post says:


Quoting 
Expectancy is your profit percentage per win multiplied by your win rate minus your loss percentage per loss multiplied by your loss rate.

Hmm. I got mine from Elliott Wave's version in NinjaTrader.

We do agree, higher the better. An expectancy of less than 1.0 means you can expect it to lose money

I wonder how it will compare to each other in actual optimization testing?

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/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #10 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,052 since Jun 2009
Thanks: 31,658 given, 94,944 received


More from user Elliott Wave here:
Optimizer Type: Max. Expectancy - NinjaTrader Support Forum

Let me know your thoughts!

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/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Expectancy custom fitness


September 29, 2010


Upcoming Webinars and Events
 

Dealing with burnout w/Linda Bradford Raschke

Elite only
     



Copyright © 2020 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