/*[[ Name := sup_res Author := Copyright © 2004, MetaQuotes Software Corp. Link := http://www.metaquotes.net/ Separate Window := No First Color := Blue First Draw Type := Symbol First Symbol := 119 Use Second Data := Yes Second Color := Red Second Draw Type := Symbol Second Symbol := 119 ]]*/ Variable : shift(0),res(0),sup(0); SetLoopCount(0); // loop from first bar to current bar (with shift=0) For shift=Bars-1 Downto 0 Begin if close[shift+2]>= iMA(10,MODE_SMA,shift+2)and close[shift+1]< iMA(10,MODE_SMA,shift+1)then res=high[Highest(MODE_HIGH,shift+20,20)]; if close[shift+2]<= iMA(10,MODE_SMA,shift+2)and close[shift+1]> iMA(10,MODE_SMA,shift+1)then sup=low[lowest(mode_low,shift+20,20)]; SetIndexValue(shift, res); SetIndexValue2(shift, sup); if close[shift+1]res then MoveObject("trade",OBJ_FIBO,time[shift+1],res,time[shift+1],sup,green,1,STYLE_DASH)else if close[shift+1]sup then MoveObject("trade",OBJ_FIBO,time[shift+1],res,time[shift+1],sup,green,1,STYLE_DASH); End;