function Update(period, mode) if (period>first) then box_top=0.; box_bottom=0.; state=1; for i=first,period,1 do if state==1 then box_top=source.high[i]; elseif state==2 then if box_top<=source.high[i] then box_top=source.high[i]; end elseif state==3 then if box_top>source.high[i] then box_bottom=source.low[i]; else box_top=source.high[i]; end elseif state==4 then if box_top>source.high[i] then if box_bottom>=source.low[i] then box_bottom=source.low[i]; end else box_top=source.high[i]; end elseif state==5 then if box_top>source.high[i] then if box_bottom>=source.low[i] then box_bottom=source.low[i]; end else box_top=source.high[i]; end state=0; end BuffUP[i]=box_top; BuffDN[i]=box_bottom; state=state+1; end end end

Who is online

FXCodeBase. The Ultimate source of the indicators and signals for the FXCM Trading Station and Marketscope applications

Forex Capital Markets, LLC. ("FXCM LLC") is an independent legal entity and is not affiliated with Gehtsoft USA LLC.http://fxcodebase.com is not owned, controlled, or operated by FXCM LLC. FXCM does not endorse any product or service of Gehtsoft USA LLC. Nothing associated with this promotion shall be considered a solicitation to buy or an offer to sell any product or service to any person in any jurisdiction where such offer, solicitation, purchase or sale would be unlawful under the laws or regulations of such jurisdiction.