该策略的主要思想是通过绘制未来价格延伸线,并结合当前价格与该线的关系,判断未来价格的方向。当价格高于或低于延伸线时,可以相应做多或做空。
未来价格延伸线(Future Lines of Demarcation,FLD)代表着未来特定周期内的中位价、最高价或最低价。该策略运用FLD判断价格未来走势,其原理是:
该策略主要优势有:
该策略主要风险有:
该策略可从以下方面进行优化:
该策略通过比较价格与位移后的未来价格延伸线,判断价格未来走势方向,属于典型的趋势跟踪策略。总体来说逻辑清晰易懂,实施风险较小。通过参数优化和指标组合,可以获得较好的策略效果。
/*backtest start: 2023-01-29 00:00:00 end: 2024-02-04 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=2 //////////////////////////////////////////////////////////////////// // Copyright by HPotter v1.0 15/02/2017 // An FLD is a line that is plotted on the same scale as the price and is in fact the // price itself displaced to the right (into the future) by (approximately) half the // wavelength of the cycle for which the FLD is plotted. There are three FLD's that can be // plotted for each cycle: // An FLD based on the median price. // An FLD based on the high price. // An FLD based on the low price. /////////////////////////////////////////////////////////////////// strategy(title="FLD's - Future Lines of Demarcation", overlay=true) Period = input(title="Period", defval=40) src = input(title="Source", defval=hl2) reverse = input(false, title="Trade reverse") FLD = src pos = iff(FLD[Period] < close , 1, iff(FLD[Period] > close, -1, nz(pos[1], 0))) possig = iff(reverse and pos == 1, -1, iff(reverse and pos == -1, 1, pos)) if (possig == 1) strategy.entry("Long", strategy.long) if (possig == -1) strategy.entry("Short", strategy.short) barcolor(possig == -1 ? red: possig == 1 ? green : blue) plot(FLD, title="FLD", style=line, linewidth=1, color=black, offset = Period)