This strategy uses the Vortex indicator to determine market trend direction and identify long opportunities. It adds RSI filter and stop loss/take profit management to build a more complete stock long-only trading system. It can effectively identify uptrends and allows parameter customization.
Calculate the positive VIP and negative VIM of Vortex indicator.
When VIP crosses above VIM, and close is higher than previous high, a buy signal is generated.
Calculate RSI values. When RSI crosses below 70, a sell signal is generated.
When VIM crosses below VIP, and close is lower than previous low, a sell signal is also triggered.
Set stop loss at stop_loss% of initial capital, and take profit at Target_profit% of initial capital.
Vortex indicator judges bullish/bearish trends well. Adding RSI prevents overheating risks. Stop loss/take profit adds robustness.
Vortex accurately identifies trends with clear signals.
RSI avoids overheating risks and chasing tops.
Dynamic stops set predefined risk/reward ratio.
Adjustable stops fit different market environments.
Simple clear rules, easy to implement.
Expandable with other indicators.
Vortex has lagging effect, may miss opportunities.
Stop loss too small may cause whipsaws.
Take profit too large may limit profits.
RSI over-reliance causes failures.
Trading costs not considered.
No position sizing rules.
Test and optimize parameters for Vortex and RSI.
Try combining Vortex with OBV etc.
Enhance stop loss strategies like trailing stop, chandelier exit etc.
Add position sizing module to limit single trade loss.
Consider more filters like KD, MACD for entry timing.
Utilize machine learning for better parameter optimization.
Add fundamental factors to improve win rate.
This strategy integrates Vortex for trend and RSI for overheating control into a stable long-only stock system. The stop loss/take profit settings also keep risk manageable. Further improvements in parameter tuning and new modules can make it more robust for live trading. With strong trend following capacity and expandability, this strategy suits active investors well.
/*backtest start: 2023-08-19 00:00:00 end: 2023-09-18 00:00:00 period: 1h basePeriod: 15m exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}] */ //@version=4 //////////////////////////////////////////////////////////// // Copyright by Sauciusfinance //////////////////////////////////////////////////////////// strategy(title="Vortex and RSI ts 2020",calc_on_order_fills=true,calc_on_every_tick =true, initial_capital=20000,commission_value=.25,overlay = true,default_qty_type = strategy.cash, default_qty_value = 20000) //inputs//////////////////////// n = input(title="vortex period",type=input.integer, defval = 14) m = input(title = "RSI period", type=input.integer, defval = 14) // CALCULATIONS *** /////// VMP = sum( abs( high - low[1]), n ) VMM = sum( abs( low - high[1]), n ) STR = sum( atr(1), n ) VIP = VMP / STR VIM = VMM / STR // bring the lines in the panel below, add another panel with RSI plot(VIP, title="VI +", color=#311B92) plot(VIM, title="VI -", color=#FF006E) // RSI on total price, always totalprice = (high + low+close + open)/4 myrsi = rsi(m, totalprice) strategy.initial_capital = 50000 //// TRADING SYSTEM CODE //// entryl = crossover(VIP, VIM) and close >= high[1] strategy.entry("Long", true, when=entryl, comment = "Go!") exit1 = crossover(VIM, VIP) and close <= low[1] strategy.close("Long", when=exit1, comment = "Vortex down") exit2 = crossunder(myrsi, 70) strategy.close("Long", when=exit2, comment = "RSI down") //money management stop_loss=input(7, "Stop loss %", minval = 1, step = 1) sl = -1*stop_loss/100*strategy.initial_capital close_Stop = strategy.openprofit < sl strategy.close("Long", when = close_Stop) Target_profit=input(16, "Target Profit %", minval = 1, step = 1) tp = Target_profit/100*strategy.initial_capital close_Target = strategy.openprofit > tp strategy.close("Long", when = close_Target)