GBS高低点确认策略是一个基于价格高低点变化来捕捉交易机会的策略。该策略通过识别特定的高点和低点形态,在高点突破时开仓做多,在低点跌破时平仓。该策略的主要思路是利用价格的波动规律,在相对高位开仓,在相对低位平仓,以此来获取价差收益。
该策略的核心是识别潜在的进场点和出场点。进场条件是当前高点低于前一个高点,且前一个高点高于前两个高点(high < high[1] and high[1] > high[2])。当该条件满足时,标记进场高点并在该水平画一条绿线。买入条件是存在已记录的进场高点(entryHigh),当前高点突破该水平且开盘价低于进场高点。
出场条件与进场条件类似,是当前低点高于前一个低点,且前一个低点低于前两个低点(low > low[1] and low[1] < low[2])。当该条件满足时,标记出场低点并在该水平画一条红线。卖出条件是存在已记录的出场低点(exitLow),当前低点跌破该水平且开盘价高于出场低点。
GBS高低点确认策略是一个基于价格高低点形态的交易策略,通过识别特定的进场和出场条件来捕捉价差机会。该策略的优势在于其简单性和直观性,但同时也存在一些潜在的风险,如错误信号和缺乏风险控制措施。为进一步改进该策略,可以考虑引入止损止盈机制,结合其他技术指标,并对参数进行优化。在实际应用前,全面的回测和前向测试是必要的。
/*backtest start: 2023-04-22 00:00:00 end: 2024-04-27 00:00:00 period: 1d basePeriod: 1h exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=5 strategy("GBS TOP BOTTOM Confirmed", overlay=true) // Entry condition var float entryHigh = na var line entryLine = na entryCondition = high < high[1] and high[1] > high[2] if (entryCondition) entryHigh := high[1] // entryLine := line.new(bar_index - 1, entryHigh, bar_index + 10, entryHigh, color=color.green) // Buy condition based on nearest entry buyCondition = not na(entryHigh) and high > entryHigh and open < entryHigh // Exit condition var float exitLow = na var line exitLine = na exitCondition = low > low[1] and low[1] < low[2] if (exitCondition) exitLow := low[1] // exitLine := line.new(bar_index - 1, exitLow, bar_index + 10, exitLow, color=color.red) // Sell condition based on nearest exit sellCondition = not na(exitLow) and low < exitLow and open > exitLow // Strategy logic strategy.entry("Buy", strategy.long, when = buyCondition) strategy.close("Buy", when = sellCondition) // Plot tiny dot above high[1] for entry condition plotshape(series=entryCondition, title="Entry Dot", color=color.rgb(3, 99, 5), style=shape.circle, size=size.tiny, location=location.abovebar, offset=-1) // Plot tiny dot below low[1] for exit condition plotshape(series=exitCondition, title="Exit Dot", color=color.rgb(107, 3, 3), style=shape.circle, size=size.tiny, location=location.belowbar, offset=-1) // Plot buy and sell signals plotshape(series=buyCondition, title="Buy Signal", color=color.blue, style=shape.triangleup, size=size.small, location=location.abovebar, text="Buy") plotshape(series=sellCondition, title="Sell Signal", color=color.orange, style=shape.triangledown, size=size.small, location=location.belowbar, text="Sell")