This is the TradeStation code for the systems shown in "Trade like a switch hitter," March 2006. If you don't trade with TradeStation, this code should be easily adapted. For the results shown in "Bean there, done that" buy next bar at o of tomorrow+(2*average(range,3)) stop; sell short next bar at o of tomorrow-(2*(average(range,3))) stop; For "Bulls only may apply" inputs:q(2),n(20); if highest(h,n)=highest(h,200) then buy next bar at o of tomorrow+(q*average(range,3)) stop; sell next bar at o of tomorrow-(q*(average(range,3))) stop; if highest(h,n)=highest(h,200) then sell short next bar at o of tomorrow-(q*(average(range,3))) stop; buy to cover next bar at o of tomorrow+(q*average(range,3)) stop; For "Capturing the trend" (without filter) inputs: u(.5); buy next bar at o of tomorrow+u*average(range,3) stop; sell short next bar at o of tomorrow-(u*average(range,3)) stop; For "Capturing the trend" (with filter) inputs: e(.6),p(15),u(.5); variables: x(0); if (c>c[1] and c[1]>c[2]) or (c=e then buy next bar at o of tomorrow+u*average(range,3) stop; sell next bar at o of tomorrow-(u*(average(range,3))) stop; if average(x,p)>=e then sell short next bar at o of tomorrow-(u*average(range,3)) stop; buy to cover next bar at o of tomorrow+(u*average(range,3)) stop;