vDr78

--vdr feat hochladen2000 RSI

Tune your offset to close paramters input rsi for entry long, short, oversold, overbought.

Tested with GER30

Enjoy!
Remove from Favorite Scripts Add to Favorite Scripts
//@version=2
strategy("--vdr feat hochladen2000 RSI", overlay=true, calc_on_every_tick=true, calc_on_order_fills=true)

offset_to_close = input(0.7, minval=0.001, step=0.1)

from_year=input(2016, minval=2000, maxval=2020)
from_month=input(1, minval=1, maxval=12)
from_day=input(1, minval=1, maxval=31)

to_year=input(2016, minval=2007, maxval=2020)
to_month=input(12, minval=1, maxval=12)
to_day=input(31, minval=1, maxval=31)

in_time()=> (time >= (timestamp(from_year, from_month, from_day, 00, 00)) and time < (timestamp(to_year, to_month, to_day, 00, 00)))

length = input( 14 )
rsiEntryLong = input( 51 )
rsiEntryShort = input( 49 )
rsiOverSold = input( 15 )
rsiOverBought = input( 85 )
price = close

vrsi = rsi(price, length)

openLong = in_time() and crossover(vrsi, rsiEntryLong)
openShort= in_time() and crossunder(vrsi, rsiEntryShort)

closeLongV3  = (open-close)>offset_to_close or crossover(vrsi, rsiOverBought)
closeShortV3 = (close-open)>offset_to_close or crossunder(vrsi, rsiOverSold)

if (not na(vrsi))
    strategy.entry("LONG", strategy.long, when= openLong)
    strategy.entry("SHORT", strategy.short, when =openShort)
    strategy.close("LONG",  when = closeLongV3 and not openShort)
    strategy.close("SHORT", when = closeShortV3 and not openLong)
Does this strategy repaint signals?
Reply
zelibobla mynmi16
In general it must not repaint, but in author's example (and displayed performance) it does because he uses Heikin Ashi candles which formula includes higher timeframe close price what leads to known bug: https://getsatisfaction.com/tradingview/topics/strategies-and-indicators-are-repainting

Please vote up for fix.
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar How It Works Chart Features Pricing House Rules Moderators Website & Broker Solutions Widgets Charting Solutions Get Help Feature Request Blog & News FAQ Wiki Twitter
Profile Profile Settings Account and Billing TradingView Coins My Support Tickets Get Help Ideas Published Followers Following Private Messages Chat Sign Out