A test strategy that draws a red horizontal line which follows a 20-period moving average by moving about a third of the distance each bar, and extends to the right.
//@version=6
strategy("drawing-line-level-breakout", overlay=true, pyramiding=0, default_qty_type=strategy.fixed, default_qty_value=1)
levelSrc = ta.sma(close, 20)
var line res = na
float level = na
if not na(levelSrc)
if na(res)
res := line.new(bar_index - 1, levelSrc, bar_index, levelSrc, color=color.red, width=2, extend=extend.right)
else
cur = line.get_y2(res)
line.set_xy2(res, bar_index, cur + (levelSrc - cur) * 0.35)
level := line.get_y2(res)
ready = not na(level)
eUp = ready and ta.crossover(close, level)
eDn = ready and ta.crossunder(close, level)
if ready and eUp
strategy.entry("L", strategy.long)
if strategy.position_size > 0 and ready and eDn
strategy.close("L")
Overview
Drawing Line Level Breakout goes long when the close crosses above that smoothed line and closes the long when the close crosses below. It takes one unit at a time with no stop loss or take profit. Its main purpose is to exercise line drawing functions in a reference corpus, so it is a code example rather than a tuned system.
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
Omar Edited WF is a trading strategy overlay built around Williams Fractals and multiple Exponential Moving Averages. It detects high and low fractal pivot points over configurable lookback periods alongside three adjustable EMA trendlines. Long entries are ma
This strategy calculates dynamic support and resistance levels using pivot highs and lows alongside a custom smoothed trend filter and a 3-period EMA. It identifies entry opportunities when price breaks out relative to the trend filter and short-term EMA cross
This strategy plots on the price chart and enters when three smoothed moving averages are aligned, RSI is on the matching side of 50, and a Williams fractal appears. An upward stack with RSI above 50 and a down fractal opens a long; the opposite setup opens a
This strategy combines three Exponential Moving Averages with Williams Fractals to execute trend-following or mean-reverting trades. It analyzes price structure using short, medium, and long-term EMAs along with fractal highs and lows. Entries trigger when fra
This strategy executes trades based on pivot levels, an exponential moving average, and a multi-stage smoothing trend line. It identifies support and resistance points from pivot highs and lows, combining them with price relationship rules against a custom smo
KC15 is a price-chart strategy that configures two moving averages, a Bollinger Band Width Percentile filter, and PMARP entry and exit thresholds for long and short trades. Users can switch each average between SMA and EMA, set lengths and colors, and toggle l