using HULL ma in a code for an indicator
Forums › ProRealTime English forum › ProBuilder support › using HULL ma in a code for an indicator
- This topic has 22 replies, 4 voices, and was last updated 4 years ago by GraHal.
-
-
06/08/2019 at 12:27 PM #100188
Hello,
I look at a 5 minute chart and want to build an indicator. One part of the indicator is based on the HULL MA direction. I can code for example: average [20] < average [20] [1] or close< average [20], etc.
I cannot do this with the HULL MA. Can someone help me? The code I need is: hullma [100] > hullma [100] [1]
Thanks in advance.
Mert
06/08/2019 at 12:40 PM #10018906/08/2019 at 12:41 PM #100190With upcoming v11 you’ll have it as number 7 at https://www.prorealcode.com/documentation/average
and there could be also predefined instructions to refer it.
As for now you can use existing code https://www.prorealcode.com/topic/hull-average-uptrend-downtrend-alert/
I suggest that you use extensively the native search box to find any possible reference to whatever concerns trading, provided it has already been discussed on the forum.
06/08/2019 at 12:59 PM #10019106/08/2019 at 1:40 PM #100193Do I do something wrong?
Sounds like yeah as I have been using Hull MA in lots of my own coded Systems lately and I don’t get that error.
You sure you have below … with the square brackets and parenthesis correct and the (close) included??
1Average[100,8](close) > Average[100,8](close)[1]Of course you could just post you code on here and somebody would spot the error in a jiffy (maybe even me! 🙂 )
EDIT / PS
Or is that (Close[1]) … I still cannot remember these simple rules! 🙁 and not got Platform open, sorry.
Good job PRT tells us when we are wrong! 🙂06/08/2019 at 2:02 PM #10019406/08/2019 at 2:15 PM #10019506/08/2019 at 2:20 PM #100196I still get the message to define the moving average.
What version PRT are you using?
I am using v 10.306/08/2019 at 2:39 PM #10019706/08/2019 at 2:45 PM #10019806/08/2019 at 2:46 PM #100199Ah right well that will be why you are getting the define average message then as if you look at what Roberto said in his post above then in v11 the Hull average is 7 and there is no 8.
EDIT /PS
IN v 10.3 attached shows the averages options and they start at 0 for Simple so 8 is Hull
06/08/2019 at 2:50 PM #10020106/08/2019 at 4:07 PM #100208Well here’s an example, looks like I used the Simplified Creation tool to try out the idea and it worked as it has made £205 in the last 4 weeks over 13 trades on Forward Test.
Looks like the Line 20 Sell condition C2 is redundant!? 🙂
If you improve below or fancy posting your code then I look forward to seeing what you got!? 🙂
1234567891011121314151617181920212223242526272829303132333435363738394041//-------------------------------------------------------------------------// Main code : HullMA DJI 30M v1.0//-------------------------------------------------------------------------//-------------------------------------------------------------------------// Main code : Triangle MA DJI 30M v1.1//-------------------------------------------------------------------------// Definition of code parametersDEFPARAM CumulateOrders = False // Cumulating positions deactivatedDEFPARAM PRELOADBARS = 1000// Conditions to enter long positionsindicator1 = Average[200,8](close)c1 = (close CROSSES OVER indicator1)IF c1 THENBUY 1 PERPOINT AT MARKETENDIF// Conditions to exit long positionsindicator2 = Average[500, 8](close)c2 = (close CROSSES UNDER indicator2)IF c2 THENSELL AT MARKETENDIF// Conditions to enter short positionsindicator3 = Average[300,8](close)c3 = (close CROSSES UNDER indicator3)IF c3 THENSELLSHORT 1 PERPOINT AT MARKETENDIF// Conditions to exit short positionsindicator4 = Average[200, 8](close)c4 = (close CROSSES OVER indicator4)IF c4 THENEXITSHORT AT MARKETENDIFEDIT / PS
Maybe it was not so good as I just looked again and I had it stopped for 2 weeks. I made most of that £205 in one trade on Friday 7 June!
06/08/2019 at 4:29 PM #10020906/08/2019 at 4:58 PM #100213 -
AuthorPosts
Find exclusive trading pro-tools on