inwCoin Martingale Strategy ( for Bitcoin )

** 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.
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!
从常用脚本中删除 添加到常用脚本
- ถ้าอยากดูผล Backtest ของกลยุทธนี้ ให้เปิดผ่าน web browser บน PC นะครับ
- ถ้าอยากติดตามเพจ ก็เข้าไปไลค์ได้ที่


I've always wondered how a martingale strat would pan out.
Awesome work! Can you add the short option of this strategy? This would be really good.
I love how the story delineates... at first we are 'martingale doesn't work and i'll prove it' then its like... wellllll......
Nice work and hopefully educational for many!
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!
首页 股票筛选器 外汇筛选器 加密货币筛选器 财经日历 如何运作 图表功能 价格 推荐朋友 网站规则 帮助中心 网站 & 经纪商解决方案 插件 图表解决方案 轻量图表库 博客 & 新闻 Twitter
概览 个人资料设置 账户和账单 推荐朋友 我的客服工单 帮助中心 已发表观点 粉丝 正在关注 私人消息 在线聊天 退出