Search Code

I'm trying to write a code for the lowest volume for a weekly bar in 4 weeks (and at least $1,000,000 shares for the week). My attempts have failed.


V1 = VOLUME() ;
L1 = LOWESTLOW(V1, BARS=4) ;
V1 >= (L1 * .99)
and
TO(Week(PERIODAMOUNT=1)) > 1000000
and VOL()>0


V1 = VOLUME() ;
L1 = LOWESTLOW(V1, BARS=4) ;
V1 >= (L1 * 1.01)
and
TO(Week(PERIODAMOUNT=1)) > 1000000
and VOL()>0

Computer code is not my thing. Please help.

Hi Alex,

Looking at your code you are wanting to find where the current volume is greater than the lowest volume value of the last 4 weeks (multiplied by 0.99) and with a Turnover greater than 1 million dollars?

If that is correct the following script will work:

V1 = VOL() ;
V2 = LOWESTLOW(V1, BARS=4) ;
V3 = TO();
V3 > 1000000 and V1 >= (V2 *0.99)

Note: This has been designed to work on a Weekly chart / scan.

Ex4

Red Line = Lowest Volume in 4 weeks, Shaded Green Zone shows the bars that pass the script criteria.

 

Hi Matthew

No, what I'm looking for on Saturday/Sunday are stocks which show that the volume for that week is lower than any of the weekly volumes for the previous 3 weeks (with a turnover greater than 1 million dollars).
Apologies for not making it clearer the first time.

This is what I've been using to look for the weekly volume that is higher than the previous 3 weeks, so I was trying to reverse it.

V1 = VOLUME() ;
H1 = HIGHESTHIGH(V1, BARS=4) ;
V1 >= (H1 * 1.01)
and
TO(Week(PERIODAMOUNT=1)) > 1000000
and VOL()>0

Kind regards
Alex

Hi Alex,

Here’s an adjusted script:

V1 = VOL() ;
V2 = LOWESTLOW(V1, BARS=4) ;
V3 = TO() ;
V3 > 1000000 and V1 <= V2

And updated example of a passing symbol / chart:

Ex6

Awesome. Thank you so much.