Can anybody help me to code in MQL4 drawing on current chart two trend lines? Green line as support and red line as resistance.

 


I would like draw the lines as the (E)xpert (A)dvisor on Meta Trader 4 and refresh it every next bar. Let's use only 100 last bars.

The green line should be drawn as the connector between two points:
1/. LOW of the last bar (always)
2/. LOWEST bar of the last 100 bars - but if the line cut the price of the bar in this range (between the last bar and last bar-100) that we ignore this LOWEST bar and
back 1 bar offset

Summarize I would like obtain something like this situation:

OK LINES - I would like obtain this situation


BAD LINES - I would not like obtain situation like this



reply on my e-mail: bemowo@go2.pl or please publish here the ready EA or indicator

Reason: