Trend detection codes
Forums › ProRealTime English forum › ProOrder support › Trend detection codes
- This topic has 44 replies, 12 voices, and was last updated 3 years ago by
monkeys nuts.
-
-
02/18/2022 at 4:04 PM #188483
I have more than enough such indicators myself. 😁 I’m trying Priceaction Short Term, few candles in the market, many trades and works in almost every market phase (M5, M1). Positive even without a trend indicator. The trend is just a small tool. At least it seems to be working.
02/19/2022 at 9:16 PM #18853902/19/2022 at 9:59 PM #18854402/24/2022 at 1:54 PM #188770here’s a short trend indicator that never fails:
123if opendayofweek = 5 and (Russia is about to invade Ukraine) thensell 1000 contracts at marketendifI now see you have a parameter wrong in there !
1 user thanked author for this post.
03/08/2022 at 9:22 AM #189585This is something i’ve used alot on a higher TF
Trend1234Timeframe (xxx,updateonclose)bull = average[x,y](close) > average[x,y*z](close)bear = average[x1,y1](close) < average[x1,y1*z1](close)Timeframe (Default)1 user thanked author for this post.
03/08/2022 at 10:15 AM #189590what sort of value would you use for z or z1 ?
the number after the comma designates the type of MA
0 = SMA
1 = EMA
2 = WMA
3 = Wilder
4 = Triangular
5 = End point
6 = Time series
7 = Hull
8 = ZeroLag
03/08/2022 at 11:36 AM #189591my bad, this is how it should be
1234Timeframe (xxx,updateonclose)bull = average[x,y](close) > average[x*z,y](close)bear = average[x1,y1](close) < average[x1*z1,y1](close)Timeframe (Default)For z and z1 i most often use a value of 1.1-2.0 with a step of 0.1
03/08/2022 at 12:05 PM #189595the period (x and x1) can only be a whole number.
5.5 will give the same result as 5, 10.8 will be the same as 10
03/08/2022 at 1:31 PM #189600if you want to establish a differential between 2 MA periods I would suggest using
1bull = average[x,y](close) > average[(x+z),y](close)then optimize the value of z, 1 to 10 with a step of 1 (for example)
2 users thanked author for this post.
03/08/2022 at 1:40 PM #18960103/08/2022 at 1:57 PM #189602it will certainly work perfectly well when x > 10
I was thinking of smaller periods when it doesn’t quite make sense … but I’m sure you’ve figured that out by now 😁
03/22/2022 at 10:02 PM #19033603/23/2022 at 8:35 AM #190342Sorry this will not work it has not been Initialised, this is only a function my main EA has been Initialised but not this function.
Hi icharttop
You may be mixing your platforms possibly? EA (Expert Adviser) is for MT4, which does require initialisation. Nothing on the ProRealCode site is for MT4, all code posted here is for ProRealTime. Hope this helps.
03/25/2022 at 7:46 AM #190448Thank You may be you can help l been on this ProRealTime for more than 2 years and all l get is NO HELP and discouragement so l decided to learn to coding with someone else called TreadView for MT4 with no coding experience. l built a complex EA that l can start my EA as a point of origin [ONCE StartTime = Point of Origin and buys 1 contact Lowest ‘Low and and buys another 1 contact on Lowest High and Calculates to a Point of Destination Sell both contact with no coding experence = Target Price
Please can you help me to code // (Doolean ONCE) (FunctionStartTime) If is time > = start hour, Start minute do Set ONCE to true = Point Origan
03/25/2022 at 7:55 AM #190449Hi icharttop
Sorry to hear that, my experience of this forum has been nothing but positive. There is a code conversion service provided on this site, I am sure they will be able to help
https://www.prorealcode.com/free-code-conversion/
Below are the code snipets for specifying trading times;
IF (Time >= 08000 AND Time <= 220000)thenTradetime=1elseTradetime=0endifIF longcondition and tradetime THENBUY PositionSize CONTRACT AT MARKETENDIFand below for Highest (or Lowest) over a specified look back range;ca1 = high > highest[100](high[1])IF ca1 THENBUY 1 shares AT MARKETENDIFGood luck!1 user thanked author for this post.
-
AuthorPosts
Find exclusive trading pro-tools on