TradingView
Real_inwCoin
26 apr 2020 11:36

inwCoin Martingale Strategy ( for Bitcoin ) 

Bitcoin / US Dollar Perpetual Inverse Swap ContractBitMEX

Descrizione

** Same as my previous martingale script but this version = opensource **

inwCoin Martingale Strategy is the proof of concept strategy that in the end, anyone who using martingale strategy will kaboom their portfolio.
For those who don't know what is "martingale".. it's a simple double down strategy in the hope to cover the loss in previous entry.
Example
In the game that if you win, you'll get 100% of your bet money back.
1st loss = 1$
2nd loss = bet 2$ : if win, get 2$ / real profit = 1$ ( 2-1 )
3rd loss = bet 4$ : if win, get 4$ / real profit = 1$ ( 4 - ( 2+1) )
4th loss = bet 8$ : if win, get 8$ / real profit = 1$ ( 8 - ( 4+2+1 ) )
...
...
10th loss = bet 512$ : if win, get 512$ / real profit = 1$ ( 512 - ( 256+128+64+32+16+8+4+2+1) )

as you can see, the next bet will be first bet x 2^(n-1)
and the profit will equal to your first bet.

==================
In trading and forex EA ( Expert Advisor or bot ) people use this strategy to fool newbies that their martingale system will generate steady income for eternity.

But in reality, this strategy will destroy your whole portfolio eventually some time in the future. Because there will be some "Blackswan event" in market at some point in time. And one who ignore this fact, will lose everything.

But, if you using low risk strategy and generate some profit from your low-risk portfolio. You can take small chunk of that profit and put it in riskier strategy like this martingale, to accerelate your profit snowball.

===================
Parameter Explaination
====================
Price = datasource for indicator calculation
Fixed position size option = if uncheck, the "Start position size" parameter will be % of your initial capital. If checked, it will fixed position size ( like 1 BTC )
Start Position Logic = condition to enter first trade
- MACD singal > 0 : Self explanatory, default macd value
- Stochastic RSI cross up : enter when sto line cross up from bottom ( 20 )
- ATR channel : enter trade if price cross above 2.3 ATR
Take Profit Percent = take profit target % from average entry
Start martingale ..= if price compare to average position entry less than this %, it will start to double down ( martingale )
Martingale Multiplier = you can specific how big you'll double down, default is 2
Trade Direction = long only for now
Use date rang = self explanatory
** make sure to setup your initial capital in properties tab **

On chart
=======
White Line = Average position price
Orange Line = your current equity

If equity less than 0, it will close any remaining positions ( It's mean your position got liquidated )
If price > equity line for "take profit percent" it will close any remaining positions.

=======
As you can see, this strategy survive 2018 drop and pump profit to 1000+% ( Check in the strategy tester tab > list of trades )
But in May 2020 -50% drop in just 3 days, your whole portfolio got liquidated.

Actually, after some digging in profit and backtest result.
This strategy, when it can survive a shape drop, can generate a lot of profit.
So, if you want to use martingale. Make sure to use only small chunk of your profit from "low-risk" strategy to accelerate your profit generation ( aka degen port )
DO NOT greedy and use all of your initial capital or borrowed money to use with this strategy!
Commenti
PineCoders
PineCoders
This publication will be featured in our "Best Scripts of The Month" selection. Thank you for your valuable contribution to the TradingView community, and congrats!
blackcat1402
This backtest really reminded me of the consequences of full automation
ZombieStar
I've always wondered how a martingale strat would pan out.
mertriver1
Awesome work! Can you add the short option of this strategy? This would be really good.
PaulE1111
@mertriver1, I have tried to put short option into this strategy but the result was very bad. As you can see in every chart, the price is always tend to go up, therefore, in most of time, this strategy has to put a lot of martingale short entries. And in my test, it always be liquidated after around 10 entries.
Zegehe557
@PaulE1111,Sir, I request you to share the script for short entries , we want to see how it works.
The_Bitmex_Scalper
I love how the story delineates... at first we are 'martingale doesn't work and i'll prove it' then its like... wellllll......
doggeii27
Hi, very fine work, this and the others you did here in TV!
allanster
Nice work and hopefully educational for many!
Altro