It is a long only strategy.
1. Buy when price breaks out of the upper band.
2. Exit has two options. Option 1 allows you to exit using lower band. Option 2 allows you to exit using moving average.
3. Option 1 preferred over option 2 if the instrument is highly volatile.
4. Slippage and commissions are not considered in the return calculation.
This Pine script is the result after I have read the book of Jason Perl "DeMark Indicators".
There are multiple indicators within this script because the book suggest to use them all together.
The following indicators are present within this script:
Bearisflip, Bullisflip, SellSetup, BuySetup, SellCountdown, BuyCountdown.
Trend lines for support and...
When the market is giving the signals for bullish trend, which shows the shorter period exponential(20) moving average crossing the longer period moving average(50), with a strength shown in the market i.e. RSI greater than 40.
So when all these conditions are met a buy signal is generated in output (Output of Ema cross and Rsi) having value as 1.
So a trader can...