Break your losing streak

 

Hi guys,


i have got an idea to break losing streak of a trading system. lets say we have a 4 consecutive losses, then we will skip two trades after first losing trade.

is it possible to code such thing? only disadvantage iam seeing here is you miss two profit trades if you dont have a streak after 1 loss...can anyone help me to figure out the code.

thank in advance....

 
  1. bunti_k23: i have got an idea
    It's called Gambler's Fallacy

  2. bunti_k23: consecutive losses, then we will skip two trades after first losing trade.
    Makes no sense. If you skip after the first loosing trade, you have one consecutive loss. Unless you can write your conditions concretely, it can't be coded.

  3. Possible, of course, per № 2. After you have your losses, you'll need to make your code trade virtually and count wins before going back to real.

  4. bunti_k23: can anyone help me to figure out the code.
    Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

 
William Roeder:
  1. It's called Gambler's Fallacy

  2. Makes no sense. If you skip after the first loosing trade, you have one consecutive loss. Unless you can write your conditions concretely, it can't be coded.

  3. Possible, of course, per № 2. After you have your losses, you'll need to make your code trade virtually and count wins before going back to real.

  4. Help you with what? You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
              No free help 2017.04.21

    Or pay someone. Top of every page is the link Freelance.
              Hiring to write script - General - MQL5 programming forum 2018.05.12

Hi william thank you for your response,

Instruement – CFD forex pairs

Broker – <Deleted>

Timeframe – 1 minute expiry

Money management – 1 step martingale

Losing streak – 4 consecutive losses i.e 8 dollars loss


here s my idea for cutting loosing streak. lill correction 


scenario -1

iam using 1 step martingale here. so far by visual backtesting i have got 4 consecutive losing signal. iam using 1$ per trade so if 4 consecutive losing trade that means 8$ loss.


scenario -2

my idea here is to skip the next trade when you get a losing trade. so here in this scenario we ve got 1st losing trade which gives us $2 loss.

second trade skip third trade again $2loss 4th trade skip 5th trade profit.


so in first scenario we ve got $8 loss and in second scenario we ve got $4 loss.

BUY CONDITION = lets say we have a buy signal (trade amount $1)which we have a loss, iam going to place again a buy trade on immediate next candle to recover the loss martingale step 2 (trade amount $2) if we get a loss in martingale step 2 (total loss $2) we are going to skip the next signal 


vice versa for Sell condition 

below image attached for reference

 

continued after loosing streak of $4 as per condition, we have 5 consecutive wins which recovered $4 loss



after last 5 wins again we have 4 more wins. so 9 consecutive wins so far,

we ve got a loss trade here finally which made to skip next trade coincidentally it was a loosing trade again 

 
bunti_k23:

Hi guys,


i have got an idea to break losing streak of a trading system. lets say we have a 4 consecutive losses, then we will skip two trades after first losing trade.

is it possible to code such thing? only disadvantage iam seeing here is you miss two profit trades if you dont have a streak after 1 loss...can anyone help me to figure out the code.

thank in advance....

Hi

this makes no sense - if a trading system is effective then it must take every trade it is offered within the rules otherwise you skew the results and will never know if it works.  

but if you wish to pursue the issue then:

in the scenario that you paint, you can assume that your system is not working with the current conditions (say a trend system trading in a consolidation period) and you would be better to have a rule that skips all trading until the next day and thereby avoid the incorrect conditions.

 
I think I see what you trying to do. You trying to avoid consec losses being too high. But you are swapping consec string of losses as your worst night mare such as buy buy buy buy buy buy all lost with buy lost then you skip next trade then you try again after that. But now the worst nightmare just changes to the case of buy skip buy skip buy skip buy skip buy skip buy etc. So you still have the same problem but it would occur at a different place or time on the chart
 
So the guys were right it is gambler's fallacy and you always end up with blow up with this exponential scaling. However if there is an algo to deal with these losses that would be interesting. There probably are people out there who can make an algo for that if it is not impossible
 
So I will share what I can think of for this problem.

Try to run a program first with just a tp and sl and the entry rules you like. 

You will see a max consec losses, avg losses and avg wins. 

Obviously it will be good if consec losses not too high

For your ea which will have scaling, you can start it only after the avg no. of losses have occurred this will help you. 

The scaling ea does not have to have scaling by 2x on loss it could be by 1.5x or even linear by plus 0.01 for example. 

The tp to sl ratio can be 1 to 1 or 2 to 1 or even 1 to 2

The higher tp to sl ratio will have smaller than 2 scale factor. So 2 to 1 tp to sl ratio can have 1.5x scaling for example. 

You can have more than one tp to sl ratio built in. For example you could start with 1 to 2 tp to sl ratio because this is high probability and then switch to 1 to 1 ratio and then to 2 to 1 ratio as the consec losses increase. 

You can stop or interrupt your program at a reasonably low number of losses maybe 4 for example and manually sort it out if you good with that. 

You can manually look at the condition and implement the ea auto trading ability to on or off as the condition you assess to be fine or maybe you assess if you scaling ea should be on buy side or sell side yourself manually. 

You can come up with an algo which after say 5 consec losses takes the lot size and divides it into say 5 groups. Each trade then starts from lot size needed divided by 5 for each group and only after each group has profited or cleared then you can start again from 0.01 as normal I.e 1 group. 

You can build an emergency recovery mode which stops the usual scaling and changes to a strategy which is probably slower but more likely to clear the losses. This interrupt mode could be a strategy known to not have too many consec losses but is slow to profit or alternatively could be a strategy that has a high number of consec losses but only uses linear scaling and still gets the job done. 

Examples of the above could be if you use a filter that says last candle must have closed as up candle and must be higher than x pips. If you keep increasing x you find that less trades are taken but consec losses are quite low. This can be helpful as an interrupt recovery module. 

Alternatively you can use a model that has a high number of consec losses inherent in it and uses linear scaling. This means that this module does not care about the problem of exponential losses. How I have possibly achieved this before was to use rsi with settings of say 88 for the buy trigger. You then use tp of 200 and sl of 5. So the ratio is 40 to 1. You scale linearly on each loss meaning increase lot size by 0.01. I can't remember what period I used for rsi but this you can play with for yourself. 

These you can see are potential recovery modules. If anyone has other ideas on these I would like to know and also on the redistribution or grouping algos or any other ideas. 


 

I think the idea of trading after a high number of losses is exactly what is described in the Gambler's fallacy

but does this rule apply if there is a winning rate higher than 50% ? for example if we test the strategy over 10 years on 28 pairs and the max number of consecutive losses is 3, then we can assume with a high probability that the trade after 3 losses will be a winner ?

i'm not sure

Jeff

 
Jean Francois Le Bas:

I think the idea of trading after a high number of losses is exactly what is described in the Gambler's fallacy

but does this rule apply if there is a winning rate higher than 50% ? for example if we test the strategy over 10 years on 28 pairs and the max number of consecutive losses is 3, then we can assume with a high probability that the trade after 3 losses will be a winner ?

i'm not sure

Jeff

If you know of such a strategy that would be fine. The point is not really to be philosophical or theoretical unless that theory is always true such as a law of nature. Gamblers fallacy is pretty much always true but if you had such a stategy it would be pointless not to take advantage of it. Most of the time strategies have inevitable strings of losses depending somewhat on tp to sl ratio and also the size of pips of the tp and sl. Less pips sl is more losses in a row
Reason: