
La estrategia utiliza una combinación de índices aleatorios como las medias móviles lisas (Stochastic RSI) y el indicador de las bandas de Brin para identificar posibles oportunidades de compra. La estrategia utiliza varias condiciones de filtración para distinguir los puntos de compra más rentables. Esto le permite identificar momentos de compra de alta probabilidad en un entorno de fluctuación del mercado.
La estrategia utiliza dos conjuntos de indicadores para identificar las oportunidades de compra.
En primer lugar, se utiliza un índice aleatorio para determinar si el mercado está sobrevendido. El indicador, combinado con el índice aleatorio y su promedio móvil, se considera una señal de sobreventa cuando la línea% K cruza su línea% D desde el punto más bajo. Aquí se establece un umbral, que se considera sobrevendido cuando la línea% K es superior a 20.
En segundo lugar, la estrategia utiliza el indicador de la banda de Brin para identificar los cambios en el precio. La banda de Brin es el descenso y el descenso del precio en función de la diferencia estándar. Cuando el precio se acerca a la descenso, se trata de un estado de sobreventa.
Una vez que se obtienen las señales de sobreventa de los dos indicadores anteriores, la estrategia agrega múltiples condiciones de filtrado para identificar aún más el momento de comprar:
La hora de compra identificada después del juicio integral, emite una señal de compra.
La estrategia de filtrado de doble indicador tiene varias ventajas:
En general, la estrategia utiliza una combinación de indicadores técnicos y filtros que permiten una identificación más precisa y confiable de la hora de compra, lo que permite un mejor desempeño de las operaciones.
A pesar de las ventajas de esta estrategia de filtrado de doble indicador, también existen algunos riesgos que deben evitarse:
Para los riesgos mencionados, la estrategia puede optimizarse de la siguiente manera:
La estrategia de filtrado de doble indicador puede optimizarse aún más en las siguientes dimensiones:
Mediante la introducción de técnicas y métodos más avanzados, la estrategia de filtración de doble indicador permite una selección de compra más precisa y una mayor capacidad de control de riesgo. Por lo tanto, se obtienen ganancias más estables y fiables en el mercado real.
En resumen, la estrategia de compra de señales de compra de doble indicador utiliza varios indicadores técnicos, como el RSI estocástico y las bandas de Brin, y combina una serie de condiciones de filtración, como la fuerza del precio y el juicio de reajuste, para identificar un momento de compra con una alta probabilidad de confianza. Si se perfecciona aún más con la optimización de parámetros, la configuración de stop loss, etc., la estrategia puede convertirse en una de las estrategias de negociación cuantitativa de estabilidad de ganancias.
Su principal ventaja es la combinación eficaz de indicadores y condiciones de filtración, lo que hace que el momento de compra sea más preciso. El riesgo y la dirección de optimización también pueden ser controlados y resueltos. En general, es una estrategia de cuantificación eficiente que se puede implementar.
/*backtest
start: 2022-11-30 00:00:00
end: 2023-12-06 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
strategy("SORAN Buy and Close Buy", pyramiding=1, initial_capital=10000, default_qty_type=strategy.percent_of_equity, default_qty_value=10, overlay=false)
////Buy and Close-Buy messages
Long_message = input("")
Close_message = input("")
///////////// Stochastic Slow
Stochlength = input(14, minval=1, title="lookback length of Stochastic")
StochOverBought = input(80, title="Stochastic overbought condition")
StochOverSold = input(20, title="Stochastic oversold condition")
smoothK = input(3, title="smoothing of Stochastic %K ")
smoothD = input(3, title="moving average of Stochastic %K")
k = sma(stoch(close, high, low, Stochlength), smoothK)
d = sma(k, smoothD)
///////////// RSI
RSIlength = input( 14, minval=1 , title="lookback length of RSI")
RSIOverBought = input( 70 , title="RSI overbought condition")
RSIOverSold = input( 30 , title="RSI oversold condition")
RSIprice = close
vrsi = rsi(RSIprice, RSIlength)
///////////// Double strategy: RSI strategy + Stochastic strategy
pd = input(22, title="LookBack Period Standard Deviation High")
bbl = input(20, title="Bolinger Band Length")
mult = input(2.0 , minval=1, maxval=5, title="Bollinger Band Standard Devaition Up")
lb = input(50 , title="Look Back Period Percentile High")
ph = input(.85, title="Highest Percentile - 0.90=90%, 0.95=95%, 0.99=99%")
new = input(false, title="-------Text Plots Below Use Original Criteria-------" )
sbc = input(false, title="Show Text Plot if WVF WAS True and IS Now False")
sbcc = input(false, title="Show Text Plot if WVF IS True")
new2 = input(false, title="-------Text Plots Below Use FILTERED Criteria-------" )
sbcFilt = input(true, title="Show Text Plot For Filtered Entry")
sbcAggr = input(true, title="Show Text Plot For AGGRESSIVE Filtered Entry")
ltLB = input(40, minval=20, maxval=99, title="Long-Term Look Back Current Bar Has To Close Below This Value OR Medium Term--Default=40")
mtLB = input(14, minval=1, maxval=40, title="Medium-Term Look Back Current Bar Has To Close Below This Value OR Long Term--Default=14")
str = input(3, minval=1, maxval=9, title="Entry Price Action Strength--Close > X Bars Back---Default=3")
//Alerts Instructions and Options Below...Inputs Tab
new4 = input(false, title="-------------------------Turn On/Off ALERTS Below---------------------" )
new5 = input(false, title="----To Activate Alerts You HAVE To Check The Boxes Below For Any Alert Criteria You Want----")
sa1 = input(false, title="Show Alert WVF = True?")
sa2 = input(false, title="Show Alert WVF Was True Now False?")
sa3 = input(false, title="Show Alert WVF Filtered?")
sa4 = input(false, title="Show Alert WVF AGGRESSIVE Filter?")
//Williams Vix Fix Formula
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
sDev = mult * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = (highest(wvf, lb)) * ph
//Filtered Bar Criteria
upRange = low > low[1] and close > high[1]
upRange_Aggr = close > close[1] and close > open[1]
//Filtered Criteria
filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh))
filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and not (wvf < upperBand and wvf < rangeHigh)
//Alerts Criteria
alert1 = wvf >= upperBand or wvf >= rangeHigh ? 1 : 0
alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand and wvf < rangeHigh) ? 1 : 0
alert3 = upRange and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered ? 1 : 0
alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr ? 1 : 0
//Coloring Criteria of Williams Vix Fix
col = wvf >= upperBand or wvf >= rangeHigh ? #00E676 : #787B86
isOverBought = (crossover(k,d) and k > StochOverBought) ? 1 : 0
isOverBoughtv2 = k > StochOverBought ? 1 : 0
filteredAlert = alert3 ? 1 : 0
aggressiveAlert = alert4 ? 1 : 0
plot(isOverBought, "Overbought / Crossover", style=plot.style_line, color=#FF5252)
plot(filteredAlert, "Filtered Alert", style=plot.style_line, color=#E040FB)
plot(aggressiveAlert, "Aggressive Alert", style=plot.style_line, color=#FF9800)
if (filteredAlert or aggressiveAlert)
strategy.entry("Buy", strategy.long, alert_message = Long_message)
if (filteredAlert or aggressiveAlert)
alert("Buy Signal", alert.freq_once_per_bar)
if (isOverBought)
strategy.close("Buy", alert_message = Close_message)