Seems to be good for direction spotting during sideways and uptrend. Works only on 4h HA candles.
//@version=2 strategy("BotBot", overlay=false) atr = atr(19) avg = sma(close,19) rangeup = low + atr rangedown = high - atr over() => close/avg > 1.001 and high/rangeup > 1.04 and close/open > 1.001 under() => close/avg < 0.999 and low/rangedown < 0.96 and close/open < 0.999 longCondition = over() shortCondition = under() plot(close/avg, "close/avg", red) plot(high/rangeup, "high/rangeup", blue) plot(close/open, "close/open", green) strategy.entry("long", strategy.long, when=longCondition) strategy.entry("short", strategy.short, when=shortCondition)
lines 3-6: RangeUp and RangeDown variables are conservative estimates of potential upside or downside, calculated as lowest/highest price +/- Average True Range (ATR).
lines 7-8: Buy/Sell conditions. Estimation of buy/sell momentum, values are derived by simple genetic optimization in matlab
I think the strategy could be improved in many ways