BigliBigli
New member
Hello all
I've been in this forum for the past couple of months and learned a lot from you guys.
I've been using the following indicator/strategy for the past couple of weeks and it was good for me, so I thought I share it with you and get your help in improving it.
The idea is simple, it came from Balanced BB Breakout and the fact that Bolinger band thickness squeezes before a break. I put the following simple script together that calculates the rate of change of BB (backward-looking) and if this rate of change passes a defined (user input) threshold, signals.
I used this on daily charts and the strategy is simple, enter one cent above(below) the high (low) for long(short). My target is usually one ATR for a quick scalp but it can be modified according to your personal strategy.
I love to keep my codes simple, once the signal is generated (green for long and red for short) the price on the vertical line indicates the entry, and the following bubble shows the target based on ATR.
The threshold and moving average length can be adjusted and the default numbers are the ones that worked best for me.
This is a developing indicator, please let me know what you think and I would improve it with your help.
one last thing, be careful with the threshold adjustment! The default values work well with stocks (if you want to move to futures, it should be a much smaller value close to zero). for example, on a 5 min ES, the threshold is about 0.01 as:
I've been in this forum for the past couple of months and learned a lot from you guys.
I've been using the following indicator/strategy for the past couple of weeks and it was good for me, so I thought I share it with you and get your help in improving it.
The idea is simple, it came from Balanced BB Breakout and the fact that Bolinger band thickness squeezes before a break. I put the following simple script together that calculates the rate of change of BB (backward-looking) and if this rate of change passes a defined (user input) threshold, signals.
I used this on daily charts and the strategy is simple, enter one cent above(below) the high (low) for long(short). My target is usually one ATR for a quick scalp but it can be modified according to your personal strategy.
I love to keep my codes simple, once the signal is generated (green for long and red for short) the price on the vertical line indicates the entry, and the following bubble shows the target based on ATR.
The threshold and moving average length can be adjusted and the default numbers are the ones that worked best for me.
Rich (BB code):
#
# Rate of change in BB thickness
#
# Author: Ali Mohtat (BigliBigli)
# Version: 2021-04-15 V1
#
# This code is licensed (as applicable) under the GPL v3
#
# ----------------------
declare lower;
def lookback = 1.0;
input sma_length = 9;
input Target_ATR_coeff = 1.0;
input cross_over = 1.0;
def percent_bb = (BollingerBands().UpperBand - BollingerBands().LowerBand) / BollingerBands();
def slope_1 = 100 * (3 * percent_bb - 4 * percent_bb[lookback] + percent_bb[2 * lookback]) / (2 * lookback);
plot average_slope_1 = SimpleMovingAvg(slope_1, sma_length);
plot zero_line = 0;
def macd_diff = MACD() - MACD()[1];
def Long_signal = AbsValue(average_slope_1) crosses cross_over and macd_diff>0;
def Short_signal = AbsValue(average_slope_1) crosses cross_over and macd_diff<0;
AddVerticalLine(Long_signal, high + 0.01,color.GREEN);
AddChartBubble ( Long_signal, 0, high + 0.01 + Target_ATR_coeff * ATR(), Color.GREEN, yes);
AddVerticalLine(Short_signal, low - 0.01,color.RED);
AddChartBubble (Short_signal, 0, low - 0.01 - Target_ATR_coeff * ATR(), Color.RED, NO);
This is a developing indicator, please let me know what you think and I would improve it with your help.
one last thing, be careful with the threshold adjustment! The default values work well with stocks (if you want to move to futures, it should be a much smaller value close to zero). for example, on a 5 min ES, the threshold is about 0.01 as:
Last edited: