Hi Steve
I created test indicator for this "2 Step Entry system" >> please check it below
I try to create Entry trigger for my Strategy where I have several other variables for Entry Condition (Long or Short Trends + other market conditions) so this is just Trigger Condition for that >> Final purpose is use Strategy with 3Commas for Trading automation
Answers for your questions:
(IS THAT JUST ONE BAR UP?):
- Yes, Final trigger ON right after first RSI bar turns upwards
(how do you define LOCAL TOP?):
- Hmm this is hard :D.... script should search Local Top as long as RSI rises Up after crossover + when Top has found and we see 2 continuous bars down = Top is confirmed and we start to search next RSI bar which closes upwards == Final Entry signal
I managed to FIX issues that script does not find any trigger point but now it seems that it triggers Entry even if Top has not formed properly
Hopefully I managed to clarify my thoughts to you
Best Regadrs
Jari
////////////////////////////////////////////////////////////////
Code: Select all
//@version=5
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
indicator(title='JAT RSI MTF', format=format.price, precision=2)
// INPUT
ob = input(title='Overbought', defval=70)
os = input(title='Oversold', defval=30)
res1 = input.timeframe(title='Rsi1 Timeframe', defval='6')
res2 = input.timeframe(title='Rsi2 Timeframe', defval='6')
res3 = input.timeframe(title='Rsi3 Timeframe', defval='12')
res4 = input.timeframe(title='Rsi4 Timeframe', defval='24')
len1 = input.int(title='Rsi1 Length', defval=3, minval=1)
len2 = input.int(title='Rsi2 Length', defval=14, minval=1)
len3 = input.int(title='Rsi3 Length', defval=14, minval=1)
len4 = input.int(title='Rsi4 Length', defval=14, minval=1)
allowRepainting = input(true, 'Allow Repainting?')
// CALC
rsiL1 = ta.rsi(close, len1)
rsiL2 = ta.rsi(close, len2)
rsiL3 = ta.rsi(close, len3)
rsiL4 = ta.rsi(close, len4)
rsi1 = allowRepainting ? request.security(syminfo.tickerid, res1, rsiL1) : request.security(syminfo.tickerid, res1, rsiL1[1], lookahead=barmerge.lookahead_on)
rsi2 = allowRepainting ? request.security(syminfo.tickerid, res2, rsiL2) : request.security(syminfo.tickerid, res2, rsiL2[1], lookahead=barmerge.lookahead_on)
rsi3 = allowRepainting ? request.security(syminfo.tickerid, res3, rsiL3) : request.security(syminfo.tickerid, res3, rsiL3[1], lookahead=barmerge.lookahead_on)
rsi4 = allowRepainting ? request.security(syminfo.tickerid, res4, rsiL4) : request.security(syminfo.tickerid, res4, rsiL4[1], lookahead=barmerge.lookahead_on)
// 2 step Long Entry Condition
LongTrigCond = false
if ta.crossover(rsi1, rsi4) /// Trigger 1, this should stay ON and wait local TOP to form + pull down at least 2 bars + turn back up again to make ENTRY
float rsiLongTrigPeak = na
rsiLongTrigPeak := rsi1[1] > rsi1 and rsi1 > rsiLongTrigPeak ? rsi1[1] : rsiLongTrigPeak // Local TOP calculation
if rsiLongTrigPeak > 0 and rsiLongTrigPeak > rsi1 and rsiLongTrigPeak > rsi1[1] and rsi1[1] < rsi1[2] and rsi1 < rsi1[1] // PullBack Calculations after Local TOP
RsiUpOK = false
if rsi1 > rsi1[1] // Final Trigger for Entry
RsiUpOK := true
LongTrigCond := true
if ta.crossunder(rsi3, rsi4) // This is just test Close
LongTrigCond := false
// PLOT
plotshape(LongTrigCond, title="Long Entry Trigger", location=location.top, color=color.green)
plot(rsi1, 'RSI 1', color=color.new(#04ff04, 0))
plot(rsi2, 'RSI 2', color=color.new(#ff4141, 0))
plot(rsi3, 'RSI 3', color=color.new(#dad6d6, 0))
plot(rsi4, 'RSI 4', color=color.new(#f3ff45, 1))
upperBand = hline(ob)
lowerBand = hline(os)
fill(upperBand, lowerBand, color=color.new(color.purple, 90))