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

Re: Continuous contract



PureBytes Links

Trading Reference Links

Most of the popular contracts roll on a specific day. For example, the
stock indices, SP, ES, ND, NQ, etc., roll at the pit (day session)
opening on Thursday, the day before the second Friday of the month. For
continuous daily contracts, you'd use the pit close on Wednesday, the
day before that. Here's some EL code for that Wednesday.

{Function: SpLastDay}

splastday = false;

if dayofweek(d) = 3 then begin
  if dayofmonth(d) <= 12 then begin
    if dayofmonth(d) >= 6 then begin
      if mod(month(d),3) = 0 then splastday = true;
    end;
  end;
end;

-- 
  Dennis