no trade in non trending market
Forums › ProRealTime English forum › ProOrder support › no trade in non trending market
- This topic has 7 replies, 3 voices, and was last updated 6 years ago by George65.
-
-
02/22/2018 at 11:06 AM #6347802/22/2018 at 11:40 AM #63501
There are several ways, a pair of Moving Averages with small (you have to tell what small is for you) differences, Bollinger Bands narrowing for, say, two consecutive bars, no price movement over “n” pips for at least “x” bars….It’s up tou you to tell when a range is starting.
It’s a lot easier to spot it on a chart, especially when it ends!
02/22/2018 at 11:46 AM #6350302/22/2018 at 12:06 PM #63506This Nicolas‘post when, as a novice, I needed some help https://www.prorealcode.com/topic/detecting-a-range/#post-10338.
The following example uses narrowing Bollinger Bands for just 1 (or whatever number you want to set) bar.
First you have to define a BB:
123456// Set up a Bollinger BandONCE BBavg = 20 //20-period BBONCE BBdev = 2.0 //2.0 BB DeviationBBmean = average[BBavg,0](close) //BB mean (middle line)BollUP = BBmean + ((std[BBavg](close)) * BBdev) //BB Upper BandBollDN = BBmean - ((std[BBavg](close)) * BBdev) //BB Lower BandThen you have to determine when the BB starts narrowing, because the price is likely to enter a range:
123// Determine current status of BB (Narrowing)ONCE NarrowingBars = 1 //You may want to change this to suit your needsNarrow = (summation[NarrowingBars]((BollUP < BollUP[1]) AND (BollDN > BollDN[1])) = NarrowingBars)Now you can use the variable NARROW to check whenever you want:
1IF Your_Conditions AND not Narrow THEN....1 user thanked author for this post.
02/22/2018 at 12:15 PM #6350802/22/2018 at 1:40 PM #63516I find the best practise is using highs and lows. By definition a trend can only exist (up) if prices are making higher highs and higher lows.
02/22/2018 at 1:53 PM #63519123456789101112131415ema = exponentialaverage[48](close)ema2 = exponentialaverage[24](close)//set trend using highs and lowsTrend1= highest[2](high)Trend2= highest[5](high)Trend3 = trend1-trend2///Trend4= lowest[2](low)Trend5= lowest[5](low)Trend6 = trend4-trend5////add trend3 and trend6 commands to codeLong = (emaabove and trend3 <0)Short = (emabelow and trend6 >-1)I use the above code. I have found it does well at keeping you out of sideways markets but is not perfect so any edits that people might have would be useful. Different FX pairs behave differently for the second value [n] depending on what time or other variables control your entry criteria.
2 users thanked author for this post.
02/22/2018 at 3:04 PM #63527 -
AuthorPosts
Find exclusive trading pro-tools on