Slippage
Posted: Jan 14 2015
Hello. Change the code to warrant follow the price or how to avoid slippage.
Code: Select all
inputs: Price( Close ), Length( 5 ), ConfirmBars( 1 ) ;
variables: var0( 0 ) ;
condition1 = Price < AverageFC( Price, Length ) ;
if condition1 then
var0 = var0 + 1
else
var0 = 0 ;
condition1 = CurrentBar > ConfirmBars and var0 = ConfirmBars ;
if condition1 then
sellshort ( "MACrossSE" ) next bar at Price limit;