Welcome to NexusFi: the best trading community on the planet, with over 200,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I am trying to edit this RVOL script to fit thinkscript and am having trouble.... anyone who could help I would love!!!
//@version=3
study("RVOL - Final on 814 for 3m Candles ONLY")
//Trade Ideas Relative Volume Indicator used to assist in alignment of the final ratio. Final adjustment used the square root function.
start_hr = input(9,"Session Start - Hour", minval = 0, maxval = 30) //NASDAQ starts at 9:30 and ends at 16:00
start_min = input(30,"Session Start - Min", minval = 0, maxval = 59) //NSE - India starts at 9:15 and ends at 15:30
end_hr = input(16,"Session End - Hour", minval = 0, maxval = 30)
end_min = input(00,"Session End - Min", minval = 0, maxval = 59)
//Converts start & end time into fractional hour
start_time = (start_hr + (start_min/60))
end_time = (end_hr + (end_min/60))
total_min_in_session = (end_time - start_time)*60 //Total minutes in a trading day
bar_interval = 3 //Assigns timeframe value to bar_interval. e.g 5 min chart => 5, 1 H chart => 60
no_of_bars = 130 //((total_min_in_session/bar_interval)) //This gets no. of bars in an intraday session for given timeframe. e.g 5 min chart => 75, 30 min chart => 13
rvol_average = input(20,"RVOL Period", minval = 1, maxval = 20) //Calculates average volume of till that time volume of given number of sessions. Not quite sure what I said, ehh ?
//Getting the current bar number in the current session. For 5 min chart it should be between 1 to 75
fr_now = ((minute + bar_interval)/60) //Currentbar fraction hour
currentsession_bar_no = ((hour + fr_now) - start_time)*(60/bar_interval) //Currentbar number from start of the session e.g end of session bar numbber = 75, start of session bar number = 1
//RVOL Calculation
x = 130
//Sectional RVOL Calculation as per users choice
rvol_sectional = input(true, title = "RVOL Sectional", type = bool)
//Now updated script will divide session into available full hours of the trading day. e.g NSE in 6, NASDAQ in 6, LSE in 8 likewise
trday_sessions = floor(end_time - start_time)
rvol_from_session = input(1, title = "RVOL From Session", type = integer, minval = 1, maxval = 12) //You take bar start of that session
rvol_to_session = input(6, title = "RVOL To Session", type = integer, minval = 1, maxval = 12) //You take one bar below that session (Use Ceil function)
//This ensures the trading day is divided into full hour sessions
rvol_from_session := rvol_from_session <= trday_sessions ? rvol_from_session : trday_sessions
rvol_to_session := rvol_to_session <= trday_sessions ? rvol_to_session : trday_sessions
if (calculate_sec_rvol == 1)
volsum_current_sec := (currentsession_bar_no == rvol_bar_start) ? volume : volsum_current_sec[1] + volume
//Clears volume sum history at the start of session
if (currentsession_bar_no == rvol_bar_start)
volsum_history_sec := 0
if (n >= x)
for i = 1 to rvol_average
volsum_history_sec := volsum_history_sec + volume[no_of_bars*i]
if (currentsession_bar_no > rvol_bar_end)
RVOL_sec := 0
volsum_current = 0.0
volsum_history = 0.0
volsum_current := (minute == start_min and hour == start_hr) ? volume : volsum_current[1] + volume
//Clears volume sum history at the start of session
if (minute == start_min and hour == start_hr)
volsum_history := 0
if (n >= x)
for i = 1 to rvol_average
volsum_history := volsum_history + volume[no_of_bars*i]