The main idea of this strategy is to predict the future price trend by drawing future price extension lines and comparing the current price with the lines. It can make long or short positions accordingly when the price is higher or lower than the extension line.
The Future Lines of Demarcation (FLD) represents the median, highest or lowest price in a certain future period. The strategy uses FLD to determine the future price movement. The principle is:
The main advantages of this strategy:
The main risks of this strategy:
The strategy can be optimized in the following aspects:
The strategy judges future price trend by comparing price with displaced future price extension line. It’s a typical trend following strategy. The logic is clear and easy to understand, with relatively small implementation risk. By parameter optimization and indicator combination, good strategy results can be obtained.
/*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)