Hull average Uptrend downtrend alert
Forums › ProRealTime English forum › ProScreener support › Hull average Uptrend downtrend alert
- This topic has 5 replies, 2 voices, and was last updated 5 years ago by robertogozzi.
Tagged: Hull Average
-
-
11/10/2018 at 8:10 AM #84526
Hi everyone,
This is my first post and was hoping I could get some help with my proscreener. I am looking for a code to alert me when my hull average changes from downtrend to uptrend (i.e. colour changes on the chart). Below is the Hull average code I’m using (it is taken from a blog post by Nicolas ), and I’m unsure what I need to add to make it work for the alert.
Many thanks in advance.
JP
Hull Average Code:
Hull Average12345678//Hull Average Code://HullMA, the Hull Moving Average:Period = 14Data = Closeinner = 2*weightedaverage[round(Period/2)](Data)-weightedaverage[Period](Data)S = weightedaverage[round(sqrt(Period))](inner)return S11/10/2018 at 11:00 AM #84532To write code, please use the <> “insert PRT code” button, to make your code easier to read. Thank you.
S is what is returned and displayed on the chart, so you just need to check if current S is different from the previous candle, if it’s higher then it’s bullish while if it’s lower then it’s bearish:
Hull Average123456789101112//HullMA, the Hull Moving Average:Period = 14Data = Closeinner = 2*weightedaverage[round(Period/2)](Data)-weightedaverage[Period](Data)S = weightedaverage[round(sqrt(Period))](inner)Result = 0IF S > S[1] THEN //higher than previousResult = 1ELSIF S < S[1] THEN //lower then previousResult = 2ENDIFSCREENER [Result]11/10/2018 at 2:04 PM #8454411/11/2018 at 8:38 AM #84568Thank you, I have put the code into the screener but realised it will also show as a buy if the hull is going up relative to the previous price.
I was wondering if it is possible to change the so that it only flags up the security when the colour change happens, so only the first move from negative to positive and vice versa?
Also, how do I add into the code a second hull moving average so that when both are both bullish or both bearish I get an alert? Do I just add “and” into the bottom of the code?
Many thanks, and apologies for the stupid questions, as you can tell, coding isn’t one of my strong points.
JP
11/11/2018 at 8:58 AM #84569Hi again,
Don’t worry about the adding of the second indicator, I have found some info on how to sort that.
Final question, is it possible to open two proscreener windows so I can check multiple screening options, so have one bearish open and one bullish?
Many thanks
JP
11/11/2018 at 9:21 AM #84574You can open many screeners, I don’t know about any limit, just duplicate your screener with a different name.
The correct code is:
12345678Result = 0Bull = S > S[1]Bear = S < S[1]IF Bull AND Bear[1] THEN //Red to GreenResult = 1ELSIF Bear AND Bull[1] THEN //Green to RedResult = 2ENDIF -
AuthorPosts
Find exclusive trading pro-tools on