| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| Recovery Strategy Simulator https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=259 |
Page 1 of 1 |
| Author: | gaheitman [ Mon Jan 16, 2012 11:33 pm ] |
| Post subject: | Recovery Strategy Simulator |
A few PMs today with Mike (magft) inspired me to write the attached indicator. I wanted to "see" the difference between some of the recovery systems that have been offered lately. I was originally going to write a simulator in VB or Delphi, but decided I might as well use a tool that we are all familiar with and that can be easily extended (and de-bugged :>) by many of us. So I wrote an indicator that will simulate trades and play through the various recovery scenarios. What you tell it Win/Loss ratio of your system - If you win 45% or the time, you enter 0.45. Reward/Risk ratio - If you TP is 2.5 times your SL, you enter 2.5. Iterations - The number of cycles you want to simulate. Each cycle ends when you are in profit. Recovery Method - One of Shakey, Blackjack, Martingale Martingale multiplier - If you want to double with each loss, enter 2. You can also enter 1.33 or 1.5 or any other number. You can also enter 1, which simulates no recovery. Official parameters: Code: Select all For each iteration, it simulates a cycle by randomly determining if you have a win or not and adding that result to your current running balance. If at the end of a trade you are in profit, the cycle is over. If you are at a loss, it modifies the unit size according to the recovery rules and simulates the next trade. The number of trades needed to end recovery is captured and stored in an array for later display. Any trade sequences over 100 trades long are stored in the 100th bin, but the max is reported separately. Output The indicator opens a sub-window of the main chart, and charts the percentage of trades that exited after each number of trades. For example, it you have a winning percent of 60%, you should see that the bar labelled "1" is about 60%. It also charts the cumulative percent as a line, so you can see where 90 percent of the trades will close out, etc. There are also some labels that report additional information, such as the max trades needed to end a sequence and the max units reached. It also shows a comparison of return/trade with and without using recovery, which is fairly interesting. It should all be clear in the picture. You'll likely have to scroll back in time to get to the interesting bits. This is the result of a few spare hours today, so I am sure there are bugs. If anyone sees anything let me know and I'll get a new version up asap. George |
|
| Author: | magft [ Tue Jan 17, 2012 12:53 pm ] |
| Post subject: | Re: Recovery Strategy Simulator |
Nice work, i'll have a look at the code to see if there is anything a miss but i bet you've done a good job as usual. Mike |
|
| Author: | ironrick [ Tue Jan 17, 2012 10:26 pm ] |
| Post subject: | Re: Recovery Strategy Simulator |
George, Any chance we could get more of the subtext behind this? Besides showing all the stats -- which is useful and super interesting in itself -- is the tool an attempt to prove a for or against position in regards to the whole "Theory of Recovery Methods"? Ie. Do they work or not, are they worth the risk, is there really and actually any such beast as a "recovery trade" or is it just another trade etc... I personally have banned the idea from my trading vocab. I don't "believe in" any form of recovery trade, but simply move on to the next opportunity. (Note: this is different from some valid forms of hedging...) Further conversation beyond your answer needs to be in the appropriate forum section so we don't clutter this one... Just wondered where you personally were coming from and the circumstances around your decideing to code this indi. Which is VERY cool by the way. Rick |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|