[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SP Shorter #17



PureBytes Links

Trading Reference Links

here's a slightly cleaner version of system I posted yesterday -

It shorted the first 5 minute bar of the day - nice trade but it wasn't
supposed to. The problem is the setup was left over from last nights' close.
Actually I'm not sure if that's a problem or not!
Anyway here's the "corrected" version, note the addition of the Sess1endtime
qualifier

rgds phil

{SP Shorter #17}
{set TS to exit trades on the close}

{figure out opening bar stuff}
if date<>date[1] then begin
 value1=barnumber;
 value3=c data1;
 value33=open data1;
 if  value33<c[1] then condition99=true else condition99=false;  {down open}
 end

 else begin

{determine number of bars since open}
 value2=currentbar-value1;

 {average price since the open}
 value3=value3[1]+c data1;
 value93=value3/(value2+1);

 if  value93<value33 and condition99 and time<>Sess1EndTime then
  sell 1 contract value33-1 limit;

 end;