📈 RX Swing

Timeframe Enforcement: The strategy is designed to only work on a 4-hour chart. If you try to run it on any other timeframe, it will throw an error.
Inputs:
RSI length: Determines the length for the Relative Strength Index (RSI) indicator.
RSI MA Length: Determines the moving average length for smoothing the RSI.
MA Type: Allows you to choose between SMA or EMA for the RSI moving average.
Stop Loss & Take Profit: These define the exit points in percentage terms.
Capital per Trade: Defines how much capital is allocated per trade.
Lot Size: Specifies the number of Nifty options contracts to trade.
Trailing Stop-Loss Points: Defines how many points the price has to move against the position before the trailing stop is triggered.
Trading Logic:
RSI & Moving Average: The strategy generates buy (call) and sell (put) signals based on the crossover and crossunder of RSI and its moving average.
Position Size: The position size is based on capital allocated and the current price of the Nifty.
Stop Loss/Take Profit: The strategy uses both percentage-based stop loss and take profit levels, as well as a trailing stop mechanism to lock profits.
Exit Conditions:
The strategy has several exit triggers:
Trailing Stop-Loss: When the price moves against the trade by a certain number of points, it exits.
Reversal Exit: The strategy will exit a position if the opposite signal (long vs. short or vice versa) occurs.
TP/SL Exit: The strategy will also exit the position when the target profit or stop loss levels are hit.
Loss Count: The strategy tracks the number of consecutive losing trades, and if the count exceeds two, no new trades are allowed until the count resets.
Reset Loss Count: The loss count resets every day at 9:15 AM.
Plotting:
Entry signals (long/short) are marked with green (buy call) and red (buy put) triangles.
Exit signals for TP, SL, Reversal, and Trailing SL are marked with respective shapes (crosses, circles, squares).
This strategy is designed to manage risk with a stop loss and take profit system, while also incorporating a trailing stop-loss mechanism to lock in profits. It ensures that the strategy works only on the 4-hour chart, and limits trading activity after consecutive losses to maintain discipline.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
Penafian
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.