Hi,
I am struggling to figure out why this simple screener isn’t working.
I called this indicator created by Nicolas (the Relative Volume version): https://www.prorealcode.com/topic/relative-volume-rvol/
Then, I would like to run a screen from the ones with the top values for the day. I get an error:
“Syntax error: line 3, character 30
Syntax Error in Assignment”
Please assist. Would really appreciate it, thank you.
myRVOL = CALL "RVOL"
c1 = myRVOL > 1
c2 = volume > 10000
criteria = myRVOL
screen = c1 AND c2
screener [screen](criteria AS "Relative VOL")
It’s ProScreener. I’ll move it.
Do not double post.
I’ll check it tomorrow.
Try using the attached ITF file.
It works fine.
Are you sure this is the code? Looks like its related to a trading system, not ranking stocks based on relative volume.
Also, please make it in english if you can, thank you!
// Festlegen der Code-Parameter
DEFPARAM CumulateOrders = False // Kumulieren von Positionen deaktiviert
DEFPARAM FLATAFTER = 235900
// Verhindert das Platzieren von neuen Ordern zum Markteintritt oder Vergrößern von Positionen vor einer bestimmten Uhrzeit
noEntryBeforeTime = 065900
timeEnterBefore = time >= noEntryBeforeTime
// Verhindert das Trading an bestimmten Wochentagen
daysForbiddenEntry = OpenDayOfWeek = 6 OR OpenDayOfWeek = 0
R1 = 2*((DHigh(1) + DLow(1) + DClose(1) + DOpen(0))/4) - DLow(1) //R1
PP = (DHigh(1) + DLow(1) + DClose(1) + DOpen(0))/4 //PP Punkt
S1 = 2*((DHigh(1) + DLow(1) + DClose(1) + DOpen(0))/4) - DHigh(1) //S1
// Bedingungen zum Einstieg in Long-Positionen
L1 = (close > S1) // Range unten
L2 = (close < R1) // Range oben
L3 = (close < PP) // Bedingung Long
S3 = (close > PP) // Bedingung Short
ELL = (close >= PP) // Tradeziel Long
ELS = (close <= PP) // Tradeziel Short
c0 = opentime=070000 // Tradestart open 0700
IF NOT LongOnMarket and L1 and L2 AND L3 and c0 THEN
BUY 1 CONTRACT AT MARKET
ENDIF
// Bedingungen zum Ausstieg von Long-Positionen
IF LONGOnMarket AND ELL THEN
SELL AT MARKET
ENDIF
// Bedingungen zum Einstieg in Short-Positionen
IF NOT ShortOnMarket AND L1 and L2 AND S3 and c0 THEN
Sell 1 CONTRACT AT MARKET
ENDIF
// Bedingungen zum Ausstieg von Short-Positionen
IF ShortOnMarket AND ELS THEN
EXITSHORT AT MARKET
ENDIF
// Stops und Targets
SET STOP pLOSS sl //400
SET TARGET pPROFIT tp //100
Anyone have any suggestions please? I think this is an important screener for all intraday stock traders and would be appreciated by the community if resolved.
Sorry, I attached a wrong file.
This is the screener (it’s yours):
myRVOL = CALL "RVOL"
c1 = myRVOL > 1
c2 = volume > 10000
criteria = myRVOL
screen = c1 AND c2
screener [screen](criteria AS "Relative VOL")
and this is the RVOL indicator:
// https://www.prorealcode.com/topic/relative-volume-rvol/
rvol = volume/average[5](volume)
return rvol
I tested both of them on a Daily chart and they work like a charm.
The indicator is incorrect. That’s not relative volume. That’s just “above average volume”. The other indicator is relative volume which doesn’t work when used. Please let me know if that makes sense or not, happy to clear it up.
…and this is the RVOL indicator:
|
|
rvol = volume/average[5](volume)
return rvol
|
I tested both of them on a Daily chart and they work like a charm.
It’s Nicolas’code I found at the link you posted.
If it’s not correct, post the code you are using.
Nicolas’ code has two versions. The correct one which shows relative volume is this one:
Period = 5 //X days averaging period
intraindex = intradaybarindex
$ivol[intraindex] = volume
$gvol[barindex] = volume
$gintraindex[barindex] = intraindex
count = 0
sum = 0
for i = barindex downto 0 do
if $gintraindex[i]=intraindex then //found same intraday bar
sum=sum+$gvol[i]
count=count+1
endif
if count=period then
break
endif
next
avg = sum/period
rvol = $ivol[intraindex] / avg
return rvol style(histogram)//$ivol[intraindex], avg coloured(255,0,0)
Still no error is reported.
I am attaching the two files I used.
This is so weird. I just ran the exact same screener code that I had already saved in my prorealtime to test it first and it now works!
Anyway, thanks a lot Robert for being so responsive and willing to help.