Reverse martingale
Forums › ProRealTime English forum › ProOrder support › Reverse martingale
- This topic has 6 replies, 4 voices, and was last updated 4 years ago by
Oliviertrader2020.
-
-
07/09/2020 at 11:21 PM #138889
I am against all the tricks that hide the bad results of certain trading strategies.
Conversely, strategies that have a high % of winning trades can be improved (as long as there are no big losers).
Can someone help me to code a reverse martingale (a way to reinvest one’s winnings):– On the first trade I invest : 1000€ (1% of my capital)
– If the 1st trade is winning I invest 2000€ on the 2nd trade.
– If the 2nd trade is winning I invest 4000€ on the 3rd trade.
– If the 3rd trade is winning I invest 8000€ on the 4th trade.
– If the 4th trade is winning I invest 16 000€ on the 5th trade.
… and so on.As soon as a trade loses, we start the series again at 1000€ (1%) invested …
The criteria of losing exit (for example: high >= average [20]) will allow to know the distance in points of the stoploss, and thus to calculate the number of contracts to invest 1000, 2000, 40000€.
Thank you 🙂07/10/2020 at 8:53 AM #138899Remember that “Faster you can win, faster you can loose”
Have a nice day
1 user thanked author for this post.
07/10/2020 at 9:39 AM #138911I was wondering about the math you have done.
You invest twice as much each time until you loose, 1000-2000-4000-8000…… say you lose 16000 and you have previously gained 15000.
Since you will sooner or later lose, well you will ALWAYS lose 1000 (starting capital) more than you earned!
To me it makes no sense to start it all over after a loss… you will end up losing another 1000!
1 user thanked author for this post.
07/10/2020 at 5:47 PM #138974Apologies. I should have announced the goal to make it more understandable: aim for a series of 5/7/10 consecutive winning trades.
With an R/R ratio of 1, a series of 5 consecutive winning trades allows you to multiply your investment by 32 (2, 4, 8, 16, 32)
With an R/R ratio of 1, a series of 7 consecutive winning trades allows you to multiply your investment by 128 (… 64, 128)
With an R/R ratio of 1, a series of 10 consecutive winning trades allows you to multiply your investment by 1024 (… 256, 512, 1024)Of course it is rare that the ratio is exactly 1, but some strategies allow to get close to it while having probabilities high enough to reach at least 5 winning trades.
For this to be profitable you must succeed in making at least one series of 5 winning trades every 30 series, or a series of 10 winning trades every 1000 series (roughly because you have to count the spreads).
The goal is to make backtests with different strategies, on different assets, on different TF, then to launch (first in demo) those with the best potential, and then to analyze if it’s more profitable to target series of 3, 5, 7, 10 … winning trades in a row.In trading, we can be profitable in 3 ways:
– With small gains and a high success rate.
– With big wins and a lower success rate.
– With big profits and a high success rate (rarer but possible for patient traders).
It doesn’t matter which way, as long as the “strategy+moneymanagement” mix gives a positive expected value, it’s worth a try. 😉
It may be worth trying this type of moneymanagement with strategies that have high success rates.So it would be great if someone ( @nicolas can be 🙂 ) can help me code:
On the first trade I invest: 100 € (I voluntarily changed the amount to show that what’s important is the process)
– If the 1st trade is winning, invest 200 € on the 2nd trade.
– If the 2nd trade wins, invest 400 € on the 3rd trade.
– If the 3rd trade wins, invest 800 € on the 4th trade.
– If the 4th trade wins, invest 1600 € on the 5th trade.– If the 5th trade wins, start again at 100€ (and I transfer the 3100€ gain of the series to my account).
– As soon as a trade loses, we restart the series at 1000 € (1%) invested .
– The distance in stoploss points (determined by the exit criterion, e.g. if high > average [20]) should make it possible to calculate the number of contracts to be invested in order to invest the 100, 200, 400, 800 or 1600€.Thanks to those who will help me in this experiment. 🙂
07/10/2020 at 6:18 PM #138978€ 100 or €1000 depends of which instrument you want to trade, so this example deals with LOTS, starting with 1 and doubling each trade, after 5 gains I multiply by 10 the starting lotsize and after 1 loss I will restart from the original lotsize (I will multiply it by 10, because you have earned 31 lots, 1+2+4+8+16, but 10 is way high, you may want just double or treble it):
123456789101112131415161718192021ONCE LotSize = 1ONCE CurrentLots = LotSizeONCE Count = 0IF StrategyProfit < StrategyProfit[1] THENCount = 0CurrentLots = LotSizeELSIF StrategyProfit > StrategyProfit[1] THENCount = Count + 1IF Count <= 5 THENCurrentLots = CurrentLots * 2 //double each any profitable trade, till 5 is reachedELSECount = 0LotSize = LotSize * 10 //after 5 profitable trades multioly the starting lot size by 10 (1, 10, 100, 1000,....)CurrentLots = LotSizeENDIFENDIFIF MyConditions AND Not OnMarket THENBUY CurrentLots CONTRACTS AT MARKETENDIFSET TARGET pPROFIT 100SET STOP pLOSS 1001 user thanked author for this post.
07/11/2020 at 7:50 AM #138990I use this in some of my strategies, you can put the configuration into optimization to see the effective of each other
From my experience (noob level of course),
1/ Such mechanism is ‘usually’ more applicable to high win rate strategy (at least high consecutive wins)
2/ Reset the lot to initial when loss can be less profitable. After consecutive win, you loss on the biggest lot, then reset, so the next win is the smallest lot. So if win rate is high, could consider to reduce by the step size rather than reset it.
3/ Can consider also to reset after n consecutive win, anticipating possible loss is incoming. (well, I know it is negative thought). More to manage the risk considering in case the trend is going to reverse soon and your strategy may not handle well the first entry the moment when trend change.
1234567891011121314151617181920212223242526272829303132333435363738394041424344//Money ManagementMM = 0 // 0 - disable, 1 - enableif MM = 0 thenpositionsize = 1ENDIFif MM = 1 then//Configuration ----once maxSize = 2 //maximum lot sizeonce minSize = 1 //maximum lot sizeonce startingsize = 1 //starting lot sizeonce stepsize = 0.5 //lot step size to increase/decreaseonce resetafterlost = 0 //reset to starting lot size when loss. 0 - disable, 1 - enableonce doublestepdown = 0 //double the stepsize for decrease when loss. 0 - disable, 1 - enableonce resetafterstrikewin = 2 //reset the lot size to starting size after n wins//Configuration ----once positionsize = startingsizeonce wincount = 0if strategyprofit <> strategyprofit[1] thenif positionperf(1)>0 thenif positionsize < maxSize thenpositionsize = positionsize + stepsizeendifwincount = wincount + 1if wincount >= resetafterstrikewin thenpositionsize = startingsizewincount = 0endifelseif resetafterlost thenpositionsize = startingsizeelsif doublestepdown thenpositionsize = positionsize - stepsize * 2elsepositionsize = positionsize - stepsizeendifwincount = 0endifendifif positionsize < minSize thenpositionsize = minSizeendifENDIF2 users thanked author for this post.
07/12/2020 at 7:43 PM #139100Thank you very much @dowJones and @robertogozzi !
-
AuthorPosts