NexusFi: Find Your Edge


Home Menu

 



Categories Help    






Search Results
Searching for entries matching expectancy, looking in keywords for any words
Found 2 matching entries

Sort by

Entries
Bootstrapped Monte Carlo Expectancy for Robust Optimization in NT7 5 *
Description:
This algorithm is a custom performance index for the Default or Genetic optimization methods in NinjaTrader 7. Optimization with this index maximizes the 20th percentile of noise-injected bootstrapped expectancy. This metric is designed for robustness against worst case conditions. Note that due to the mathematics, the solution is not deterministic (run it multiple times, and you will get slightly different solutions each time).

Installation:
Add this file to your ...\NinjaTrader 7\bin\Custom\Type\ directory, open any indicator or strategy, and compile.

Details (this math is in here):
1. For a given series of trades of length N, the top 10% are removed, creating a modified series of trades of length N*0.9.
2. This modified series of trades is sampled *with replacement* for 10*N*0.9 samples. This series becomes the bootstrapped trade series.
3. Gaussian noise is a given mean and standard deviation is added to each bootstrapped sample.
4. Expectancy for this bootstrapped + noise series is calculated.
5. Steps 2 through 4 are done 5000 times, with different sampling from the Gaussian noise. This creates a distribution of expectancy.
6. Finally, the performance index returns the 20th percentile of these 5000 runs (so, the 1000th worst expectancy) to the NT optimizer.

Discussion:
Removal of the 10% best performing trades is an attempt to be pessimistic by assuming that the best 10% trades observed in the past will never repeat. We do not want total system performance to hang a few high-yielding trades.

Injecting noise to the bootstrapped sample accomplishes two things. First, it adds uncertainty to each bootstrapped series, thereby simulating diversity in the bootstrapped series (hopefully the diversity we would measure in a much larger sample). Secondly, it makes each bootstrap series unique. This means that we way calculate a distribution from the ensemble of bootstrapped series.

Any percentile may be returned. We could return the mean. By returning a value to the left of the mean, the 20th percentile, we are maximizing 80% of the distribution.

Note: Because we are injecting randomly sampled noise to the bootstrapped series, the solution from this performance index is not deterministic!

Suggestions:
If you use this, you should be comfortable changing the parameters found at the top of the algorithm. Adjusting the value of the standard deviation of the noise may make or break the robustness and success of this algorithm.


Category The Elite Circle 
 
Suggest other entries I might like
Details: Bootstrapped Monte Carlo Expectancy for Robust Optimization in NT7
Category: The Elite Circle 


February 3rd, 2013
Size: 9.40 KB
Downloaded: 243 times

Keywords: expectancy optimization bootstrap monte carlo
Expectancy - Van Tharp 3 *
This is another Optimizer Type for backtesting. This is the Max Expectancy formula by Van Tharp.

Elliott Wave is the author.

Here is a quote from Anagoge about the method:

Quoting 
I think this expectancy formula is a useful measure for some things (risk/reward analysis, position sizing, etc.), but I'm not sure it is a good general way to rank/select trading strategies. The reason is that it does not take into account the profit per day (number of trades). Using only expectancy as a ranking, a single trade per year gaining $100 would be ranked better than a strategy that earns $75 per trade with hundreds of trades per year. One quick and dirty way to make the expectancy consider the number of trades is to multiply it by the square root of the number of trades. I implemented a basic expectancy optimizer type a few weeks ago, and went this route, though I had to add in some multipliers to get the weighting the way I wanted it, and still wasn't that happy with it.

The most common formula I see quoted for expectancy is this:
Expectancy = (Probability of Win * Average Win$) - (Probability of Loss * Average Loss$)

Van Tharp describes expectancy here only in reference to R-multiples of a hard stop loss, so the max risk can be calculated for every trade:
https://www.iitm.com/sm-Expectancy.htm

For NT, we won't always have a hard stop, so some alternative/conditional formula will likely be necessary. He also suggests a minimum of 30 trades, but recommends 100 or more before calculating a value. A NT version might have to fudge on that requirement, or it could return 0 for less than 30 trades, but that might confuse some people.

The information here states he has a simplified expectancy formula on his DVDs, so maybe that is what people are quoting for the other formulas based on average losses, since it is easier to calculate:
https://www.iitm.com/products/position-sizing-comparison.htm

I don't have Van Tharp's books, so I don't know for sure how he describes expectancy there.

I think Van Tharp's SQN formula is one useful way to rank general trading systems. There is a version of it here in the forums, but I have not analyzed it yet. A validated version of that would be a great addition to NT 7, but my first choice would be annual and monthly Sortino ratios.

To install this you need to copy the cs file to Documents\NinjaTrader 6.5\bin\custom\Type and then compile anything or reload Ninja. You'll then have a new option in backtesting for "max expectancy".


Category NinjaTrader 6.5 Strategies 
 
Suggest other entries I might like
Details: Expectancy - Van Tharp
Category: NinjaTrader 6.5 Strategies 


July 26th, 2009
Size: 1.68 KB
Downloaded: 366 times

Keywords: tharp van expectancy
 


 
Category
 




© 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