RicardoSantos

[RS]Open Range Breakout V3

1652 vizualizações
229
1652 7
Request for DCC/coondawg71
added support for using session.

theres a issue with the session it needs to have the format inverted:
(start-end) to (end-start)
'0000-1500' to '1500-0000'
Remover dos Scripts Favoritos Adicionar para Scripts Favoritos
//@version=2
study(title='[RS]Open Range Breakout V3', shorttitle='ORB', overlay=true)
//  Request for DCC
mode = input(title='Mode (1:timeframe, 2:session):', type=integer, minval=1, maxval=2, defval=1)
tf = input(title='Timeframe for open range:', type=string, defval='60', confirm=false)
tf2 = input(title='Timeframe for range capture:', type=string, defval='D', confirm=false)
sess = input(title='Session for mode 2:', type=string, defval='0400-1500')

f_is_new_day(_mode) => _mode == 1 ? change(time(tf2))!=0 : _mode == 2 ? change(time(tf2, sess))!=0 : false

ND_open = f_is_new_day(mode) ? security(tickerid, tf, open) : ND_open[1]
ND_high = f_is_new_day(mode) ? security(tickerid, tf, high) : ND_high[1]
ND_low = f_is_new_day(mode) ? security(tickerid, tf, low) : ND_low[1]

ND_stretch = na(ND_stretch[1]) ? 0 : f_is_new_day(mode) ? (ND_stretch[1]*9 + security(tickerid, tf, (high-open)>=(open-low)?high-open:open-low)) / 10 : ND_stretch[1]

filter_high = f_is_new_day(mode) ? na : ND_high
filter_low = f_is_new_day(mode) ? na : ND_low

filter_high_stretch = f_is_new_day(mode) ? na : ND_high+ND_stretch
filter_low_stretch = f_is_new_day(mode) ? na : ND_low-ND_stretch

fh = plot(title='TR', series=filter_high, style=linebr, color=black)
fl = plot(title='BR', series=filter_low, style=linebr, color=black)
fhs = plot(title='TS', series=filter_high_stretch, style=linebr, color=green)
fls = plot(title='BS', series=filter_low_stretch, style=linebr, color=maroon)
fill(title='Positive Stretch', plot1=fh, plot2=fhs, color=green, transp=50)
fill(title='Negative Stretch', plot1=fl, plot2=fls, color=maroon, transp=50)
thanks for h=the great work and can you explain more about the TS and BS calcualtion. I am new here. thanks
Resposta
RicardoSantos davincitom
@davincitom, it calculates the range from the opening based on the timeframe and weighted by the previous value
Resposta
Change = Chance.
Resposta
RicardoSantos telepatico
i dont, but you may feel free to copy/adapt or ask/hire someone to do it.
Resposta
Hey Ricardo. I am using this study on my TradingView account with CQG. Do you have a Thinkscript version by any change? Thanks.
Resposta
RicardoSantos...What's up man...Been a long time. Your Scripts are always on point. Good Job....
Resposta
RicardoSantos ChrisMoody
thx man, means a lot coming from you.
Resposta
Início Rastreador de Fundamentos Rastreador Forex Rastreador de Sinais Criptomoedas Calendário econômico Como Funciona Recursos gráficos Planos Regras da Casa Moderadores Soluções para sites e corretoras Widgets Soluções em Gráficos Obter Ajuda Solicitação de recurso Notícias do & blog FAQ Wiki Twitter
Perfil Configurações de perfil Conta e cobrança Obter Ajuda Ideias Publicadas Seguidores Seguindo Mensagens Privadas Conversa Deslogar