// Parámetros de las Bandas de Bollinger bb_length = 20 bb_desviacion = 2 [bb_media, bb_superior, bb_inferior] = ta.bb(close, bb_length, bb_desviacion)
// Condiciones de Entrada condicion_compra = ta.crossover(ema_rapida, ema_lenta) and rsi < rsi_sobreventa and close < bb_inferior condicion_venta = ta.crossunder(ema_rapida, ema_lenta) and rsi > rsi_sobrecompra and close > bb_superior
// Ejecución de las Órdenes if (condicion_compra) strategy.entry("Compra", strategy.long)
if (condicion_venta) strategy.entry("Venta", strategy.short)
// Gestión del Riesgo stop_loss = 50 // Ajusta según el valor del futuro del NASDAQ take_profit = 100 strategy.exit("Cerrar Compra", "Compra", stop=strategy.position_avg_price * (1 - stop_loss/10000), limit=strategy.position_avg_price * (1 + take_profit/10000)) strategy.exit("Cerrar Venta", "Venta", stop=strategy.position_avg_price * (1 + stop_loss/10000), limit=strategy.position_avg_price * (1 - take_profit/10000))
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. You can favorite it to use it on a chart.
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.