Code to find support and resistance levels.

#4
Inthis code which is written iguidestock formula language you can find support and resistance level in range of 15% , It uses zigzak function on 10% level

Finding support and resistance level using zigzag function


IF ( BARNO == 0 )
{
X := GETVALUE{CLOSE[0],NOOFBARS - 1}
UPPERVAL := X * 1.15
DOWNVAL := X * 0.85
ADDTOGLOBAL{UP,UPPERVAL}
ADDTOGLOBAL{DOWN,DOWNVAL}
ADDTOGLOBAL{PIVOT,X}

}

B := PEAK[CLOSE[0];10]

C := TROUGH[CLOSE[0];10]

IF ( B <> 0 AND CLOSE[0] > PIVOT AND CLOSE[0] < UP )
{
LINEXY{0,B,NOOFBARS,B,YELLOW}

}

IF ( C <> 0 AND CLOSE[0] > DOWN AND CLOSE[0] < PIVOT )
{
LINEXY{0,C,NOOFBARS,C,RED}
}
 
#6
zigzak indicator is inbuilt indicator and it has two more sub indicator which are trough and peak. The basic idea in zigzak indicator is to findout peak and trough points in the graph and for same you need to specify minimum change required .

zigzak,peak,trough indicator are very useful in finding patterns like double top,tripple top,head and shoulder etc.

In the formula which is mentioned above troup and peak are used to findout nearest resitance and support points.
 
#8
Has anyone tried writing code to find (and plot ) the support and resistance levels?
Is there any Amibroker code available to do this ?
There is an other approch to what you are looking for and it answers this problematic :
" Breakout exploration inform you that a breakout occurred today, but AFTER todays closing bell. Would it be possible to know in advance the necessary % for such a breakout ?
If positive, then we could do something BEFORE the Market Close.
""
Credit to Dimitris Tsokakis.


Give a try to the attached file.
 
Last edited: