CODE INDICATOR: //@version=3 strategy("Pivot Reversal Strategy", overlay=true) leftBars = input(4) rightBars = input(2) swh = pivothigh(leftBars, rightBars) swl = pivotlow(leftBars, rightBars) swh_cond = not na(swh) hprice = 0.0 hprice := swh_cond ? swh : hprice[1] le = false le := swh_cond ? true : (le[1] and high > hprice ? false : le[1]) if (le) strategy.entry("PivRevLE", strategy.long, comment="PivRevLE", stop=hprice + syminfo.mintick) swl_cond = not na(swl) lprice = 0.0 lprice := swl_cond ? swl : lprice[1] se = false se := swl_cond ? true : (se[1] and low < lprice ? false : se[1]) if (se) strategy.entry("PivRevSE", strategy.short, comment="PivRevSE", stop=lprice - syminfo.mintick) //plot(strategy.equity, title="equity", color=red, linewidth=2, style=areabr) ------------------------------------ SETTING EA: INPUT: - on the signal from the indicator (immediately, do not wait to close the candle) EXIT: - Take Profit, TrailingSL, B / E, B / E +, Lost Loss ... - Counter counter starts immediately SETTINGS: - Indicator: LeftBard :( Right bars :() - the minimum span between the upper and lower edges of the indicator - maximum spread - Trading in: buy, sell, buy + sell - money management (TP, SL, B / E, B / E +, TrailingSL) - Trade volume: Fix,% of SL size - Maximum number of loss trades in a row - max. loss per day - Announcement