inputs:entrytime(955);
inputs:earlytime(1000);
inputs:exittime(1005);

vars:early_PP(0);
vars:PP28(0);
vars:LC15(0);

early_PP = entryprice - 0.03;
PP28 = entryprice - 0.28;
LC15 = entryprice + 0.15;

if time = entrytime 
and (dayofweek(date) = 4 or dayofweek(date) = 5) 
and marketposition = 0
then sellshort this bar on close ;


if time = earlytime 
and marketposition = -1 
and early_PP > close 
then buytocover this bar on close ;

if marketposition = -1 
then buytocover next bar PP28 at limit ;

if marketposition = -1 
then buytocover next bar LC15 at stop ;

if time = exittime
and marketposition = -1 
then buytocover this bar on close ;