Awesome Oscillator Crossover
Forums › ProRealTime English forum › ProScreener support › Awesome Oscillator Crossover
- This topic has 11 replies, 3 voices, and was last updated 1 year ago by OllieB.
-
-
10/13/2023 at 4:30 PM #222394
Hi All,
I am trying to code a screener which returns an awesome oscillator crossover. This means the Ao goes from below 0 to above 0, or from above 0 to below 0.
The screener code is attached. However, it is not behaving as expected. For some of the values returned the chart (with an indictor coded up in the same way) does show to AO going from negative to positive, but in other cases i get stocks returned where the AO has been positive for some time. I have (tried) to attach a screenshot which shows this. The top section is price (which can be ignored) but the lower section shows the AO and its been negative for approx 30 time periods (weeks in this case).
Can anyone shed any clues as to this strange behaviour please? The stock given as an example of unexpected behaviour is FBIO.
Many thanks.
Awesome Oscillator Crossover12345678910111213141516// sample screener codeTIMEFRAME(WEEKLY)// Awesome oscillator has crossed the 0 lineAO = (Average[AO1](MedianPrice) - Average[AO2](MedianPrice))cAOup = ((AO[1] < 0) AND (AO > 0))cAOdn = ((AO[1] > 0) AND (AO < 0))// Set vals for screenerif (cAOup) thenc1WB = 1elsif (cAOdn) thenc1WB = -1endifSCREENER [cAOup OR cAOdn](c1WB as "WB")10/13/2023 at 5:43 PM #222397Hi Ollie,
Why unexpected behavior?
You determine the distance between two averages and in the case of FBIO there is a huge downtrend going on, so the “fast” average remains below the “slow” average…
This can take a very long time indeed…
10/13/2023 at 9:19 PM #222410Hi JS,
Thanks for taking the time to reply.
Unexpected as what i’m looking for is, in a downtrend, the AO to be under the zero line for the current time period but the previous time period the AO is above the zero line. I am looking for the AO to cross from positive to negative.
This stock shows current and previous period both below the zero line.
Thanks,
10/13/2023 at 10:00 PM #22241110/14/2023 at 9:19 AM #222423Hi,
Sort of.
I don’t think i was clear in my first post. The FBIO stock shows up as a result of a screener. I have used the same code from the screener to code the indicator. This shows that the indicator has not crossed down in the last period, its been down for ages, and therefore should not be appearing in the screener as a recent crossdown.
Your chart, with new indicator, shows the point at which the AO crossed down? If so, then that could work, yes! That could be coded for a screener and only return stocks which are crossing up/down.
Thanks.
10/14/2023 at 9:34 AM #22242510/14/2023 at 10:41 AM #22242610/14/2023 at 10:43 AM #222427Hi @OllieB
I’ve tweaked your screener a bit and at least I can’t get FBIO as a result anymore…
Results from screeners are sometimes inexplicable (you’re not alone) but I think it could be due to several factors…
- Bad / polluted data
- Rounding in penny stocks
- Dividend adjustments
- …
Awesome Oscillator123456789101112131415161718TIMEFRAME(Weekly)// Awesome oscillator has crossed the 0 lineAvg20=Average[20](Close)Avg10=Average[10](Close)C1=Avg10 Crosses Over Avg20C2=Avg10 Crosses Under Avg20//cAOup = ((AO[1] < 0) AND (AO > 0))//cAOdn = ((AO[1] > 0) AND (AO < 0))// Set vals for screenerif C1 thenc1WB = 1elsif C2 thenc1WB = -1endifSCREENER [C1 or C2](c1WB as "WB")10/14/2023 at 4:37 PM #222454Hi,
Thanks for the changes. I’ve made some modifications to the screener to match the above, apart from changing “close” on the Average to “Median” to better reflect the Awesome oscillator. I also plotted 2 MAs on the chart to help see where the cross overs are happening.
48 of the 50 stocks returned from the screener looked good, i could see they matched the criteria. However, 2 did not!! I guess I’ll have to live with the 4% margin of error.
You can see that in the screenshot, the MAs have not crossed, nor is the indicator showing a crossover, yet its returned in the screener!!
Thanks.
10/14/2023 at 4:47 PM #222457Try this one:
12345678910111213141516TIMEFRAME(Weekly)// Awesome oscillator has crossed the 0 lineAvg20=Average[20](Close)Avg10=Average[10](Close)C1=Avg10 Crosses Over Avg20C2=Avg10 Crosses Under Avg20//cAOup = ((AO[1] < 0) AND (AO > 0))//cAOdn = ((AO[1] > 0) AND (AO < 0))c1WB = 0// Set vals for screenerif C1 thenc1WB = 1elsif C2 thenc1WB = -1endifSCREENER [c1WB AND range <> 0](c1WB as "WB")10/14/2023 at 4:47 PM #22245810/14/2023 at 4:51 PM #222460A big thanks for all your help.
Until next time….
2 users thanked author for this post.
-
AuthorPosts