I wish compute an indic which shows me if it's a trend market or range market.
By browsing this http://www.abctradinggroup.com/easylang ... rendlines/ I think I could use support and resistance to do that.
example (please look the attachement and my draft below) :
My idea : if the lines (support and resistance) are parallele AND these lines have a horizontal position, then it's a range. Perhaps 0 is too strict, it would be better to use a level of tolerance +/- 5 point or %.
Code: Select all
value1 : resistance[5] - resistance[0] = 0
value2 : support[5] - support[0] = 0
While check 20 last bars if value1 and value 2 then begin,
range market = true
End ;
If range market = true then
indicator = 1
Code: Select all
//extrait from http://www.abctradinggroup.com/
Variables :
DayHigh (high),
DayLow (low);
//reset on a date change
if date <> date[1] then
begin
dayhigh = Highest(high,0) ;
daylow = Lowest (low,0) ;
end ;
//update the variable tracking the highest high
if high > dayhigh then
Dayhigh = High;
//update the variable tracking the lowest low
if low < Daylow then
Daylow = low ;
//plot variables on the chart
Plot1 ( Dayhigh, "DayHigh" ) ;
Plot2 ( Daylow, "Daylow") ;
http://www.multicharts.com/trading-soft ... .php/While