Hi, I have tried to build a stock screener which is able to scan for stocks which are priced between 5 and 25 euro (condition 1) and are CROSSING THE VWAP line (condition 2)
The first condition is no problem but the second condition (both examples) seems not to work. What am I doing wrong here?
This is to where I came so far:
vw = volume*close
vwsum = SUMMATION[20](vw)
volsum = SUMMATION[20](volume)
VWAP = vwsum/volsum
PriceCond = 0
IF close >= 5 AND close <= 25 THEN
PriceCond = 1
ENDIF
C1 = PriceCond
C2 = average crosses over VWAP
C3 = average crosses under VWAP
//or:
//C2 = Open < VWAP and Close > VWAP
//C3 = Open > VWAP and Close < VWAP
screener [(C1 and C2) or (C1 and C3)]
Any suggestion is welcome!
AVERAGE is missing:
- periods
- data series on which it should make calculations.
It should be:
average[Periods](XYZ) crosses over VWAP
PERIODS can be whatever integer number you like > 0 (5, 10, 20, 100,…), XYZ can be CLOSE, VOLUME, VWAP or any other data series of your interest.
And please, post in the screener forum if your question is related to screener.. 🙄
Hi @robertogozzi , Unfortunately the code still does not work. I have tried also this conditions, but with the same result.
C2 = Open < VWAP and Close > VWAP
C3 = Open > VWAP and Close < VWAP
Is there a coding rule available with the result of a candlestick crosses over a moving average or in this case the VWAP?
It must be simple to implement such a simple coding rule in a screener, but somehow I cannot get this done.
@Nicolas, I am sorry. Next time i will address my post properly.
The logical error is in lines 1-4, say you are working with DAX at 13,000, and that volume is 10,000;
1. you multiply 13,000 by 10,000 and you get 130 million
2.you sum that value 20 times and you get 2.6 billion
3. you sum Volume 20 times and get 200,000
4. you assign VWAP 13,000 (2.6 billion divided by 200,000), so VWAP is simply the starting price, all those calculations cancel one another
How can any price be > or < to itself?