/*[[ Name := arrows template Separate Window := No First Color := Red First Draw Type := Symbol First Symbol := 234 Use Second Data := Yes Second Color := blue Second Draw Type := Symbol Second Symbol := 233 ]]*/ Vars:Zbars(12); Vars: lasttrade(0),i(0),line_top(0),line_low(0),bar(0); SetLoopCount(0); For i=Bars-Zbars Downto 0 Begin line_top=iEnvelopes(144,MODE_EMA,0.05,PRICE_CLOSE,MODE_UPPER,i); line_low=iEnvelopes(144,MODE_EMA,0.05,PRICE_CLOSE,MODE_LOWER,i); // Blue arrow - buy if close[i+2]>line_top and open[i+1]>line_top and close[i+1]>line_top and close[i+1]>open[i+1] and not lasttrade=OP_BUY then { lasttrade=OP_BUY; SetIndexValue2(i,Low[i]-5*Point); }; // Red arrow - sell if close[i+2]