OPEN-SOURCE SCRIPT

BB21_MA200_Strategy

Updated
This strategy follows the trend and keeps you in the trend until it breaks SMA 200

SMA setting is 200
BB setting is 21

BUY
====
when BB is (lower band and upper band) above SMA 200 and price crossing above BB middle line


Partial Exit
==========
When Lower BB crossing down SMA200 , exit 30%


Total Exit
=========
When BB middle band crosses down SMA200 , exit ALL


Stop Loss
======
default is set to 5%


Risk Management
================
This is new parameter I have introduced in my strategies. Default value is 10% . That means , if your capital is 10000 , you are willing to risk 10% of it ... i.e 1000.

It doesnot mean that you are buying shares/units for 1000 only. It is different ...see below

Your trade size is calculated based on Risk% .... capital x risk 5 / stop Loss units

for further explanation you can check Alexander Elder's risk management rule. He mentioned 2% rule for 100K account. But most of us dont have 100K accounts .. . so I have defaulted 10% on 10K account. You can change this values and see the results. It wont change the number of trades or profit factor. It will increase the net profit.


Warning
=======
For educational purposes only
Release Notes
Number of units calculation has been fixed.

earlier , it took more trades even though equity is not available. That has been fixed.
eemanimohaneeMoving AveragessmaTrend Analysistrendfollowing

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.

Want to use this script on a chart?

Disclaimer