Drawing Chartpoint Trendline is a strategy that calculates a 20-period simple moving average to dynamically construct a trendline using chart points between past SMA values.
//@version=6
strategy("drawing-chartpoint-trendline", overlay=true, pyramiding=0, default_qty_type=strategy.fixed, default_qty_value=1)
var line trend = na
base = ta.sma(close, 20)
float proj = na
if not na(base) and not na(base[2])
p1 = chart.point.from_index(bar_index - 2, base[2])
p2 = chart.point.from_index(bar_index, base)
if na(trend)
trend := line.new(p1, p2)
else
line.set_first_point(trend, p1)
line.set_second_point(trend, p2)
proj := line.get_price(trend, bar_index - 1)
ref = nz(proj, close)
ready = not na(proj)
sDn = ta.crossunder(close, ref)
sUp = ta.crossover(close, ref)
if ready and sDn
strategy.entry("S", strategy.short)
if strategy.position_size < 0 and ready and sUp
strategy.close("S")
Overview
Drawing Chartpoint Trendline extracts the projected line price at the previous bar as a reference level on the price chart. The strategy enters a short position when the close crosses under this projected reference line and closes the short position when the close crosses above it. It contains no adjustable inputs or predefined stop loss.
Dynamic trendline construction using chart point API
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 overlays the price chart and looks for VWAP pullbacks. It goes long when a short SMA crosses above VWAP after RSI has been oversold within ten bars, and short on the opposite cross after RSI has been overbought. Optional Minervini-style moving-av
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
This strategy generates entry signals using pivot points and uses custom Curie moving average closing lines for exiting positions. It features risk management components including percentage-based stop loss, take profit, trailing stops, and break-even levels,