Detecting Range Trends(Help)

 

Hi Guys, I have some Problems on Detecting Range trends

i Using this by myself but i think it needs some modification,

Let say

ADX_PERIOD=14

MODE_MAIN=25

t1=15

t2=60

t3=240


bool IsRange(){

if ((iADX(0,t1,ADX_PERIOD,0,MODE_MAIN,0)<ADX_MAINLEVEL)&&
(iADX(0,t2,ADX_PERIOD,0,MODE_MAIN,0)<ADX_MAINLEVEL) &&
(iADX(0,t3,ADX_PERIOD,0,MODE_MAIN,0)<ADX_MAINLEVEL))
{

return (true);

}


else return (false);


}


plz some help to make it better for detecting range (swing ) market, or if you have any idea by your self to detecting range(swing) trends

 

It is a quite a small percentage of the time that 3 different timeframes of ADX fall below a certain level all at the same time.


Which means you only get small windows in which range conditions exists (according to your criteria) when in actual fact they may be occurring more often.


And if you are going to be testing for "if" with multiple && conditions, it is better to write them as nested-ifs so you avoid computing the inner conditions if the outer ones don't satisfy. This applies in cases where the conditions are compute "intensive".

 
blogzr3:

It is a quite a small percentage of the time that 3 different timeframes of ADX fall below a certain level all at the same time.


Which means you only get small windows in which range conditions exists (according to your criteria) when in actual fact they may be occurring more often.


And if you are going to be testing for "if" with multiple && conditions, it is better to write them as nested-ifs so you avoid computing the inner conditions if the outer ones don't satisfy. This applies in cases where the conditions are compute "intensive".


Thank you very much, But what do you prefer for detecting range markets? im searchin for some code or indicator that can show or calculate a range market??can you help?

 

A single indicator is unlikely to give you what you want, so you have to use a combination of indicators, with some as triggers and others as filters -- for the specific Symbol() you are interested in.


If you click on the TA link above, the Technical Indicators are divided into Oscillator and Trend categories.