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

Re: Coding Q



PureBytes Links

Trading Reference Links

Inputs: DaysAgo(Numeric);
Array: OpenArray[50](-1);

If DataCompression < 2 then begin
 If Date > Date[1]  then begin
  for Value1 = 50 downto 1 begin
   OpenArray[Value1] = OpenArray[Value1-1];
  end;
  OpenArray[0] = Open;
 End;
 If DaysAgo <= 50 then 
  OpenD=OpenArray[DaysAgo];
End;

{ Forcing the function to series }
Value1 = OpenD[1];


=================================


Inputs: DaysAgo(Numeric);
Var: Day1Done(0);
Array: HighArray[50](-1);

If DataCompression < 2 then begin
 If Date > Date[1]  then begin
  Day1Done=Day1Done+1;
  for Value1=50 downto 1 begin
   HighArray[Value1]=HighArray[Value1-1];
  end;
  HighArray[0]=High;
 End;
 If Day1Done>0 and High > HighArray[0] then 
  HighArray[0]=High;
 If DaysAgo<=50 then 
  HighD=HighArray[DaysAgo];
End;

{ Forcing the function to series }
Value1 = HighD[1];


=================================


Inputs: DaysAgo(Numeric);
Array: LowArray[50](-1);

If  DataCompression < 2 then begin
 If Date > Date[1] then begin
  for Value1 = 50 downto 1 begin
   LowArray[Value1] = LowArray[Value1 - 1];
  end;
  LowArray[0] = Low;
 End;
 If Low < LowArray[0] then 
  LowArray[0] = Low;
 If DaysAgo <= 50 then 
  LowD = LowArray[DaysAgo];
End;

{ Forcing the function to series }
Value1 = LowD[1];


================================


Inputs: DaysAgo(Numeric);
Array: CloseArray[50](-1);

If  DataCompression < 2 then begin
 If Date > Date[1] then begin
  for Value1=50 downto 1 begin
   CloseArray[Value1]=CloseArray[Value1-1];
  end;
  CloseArray[0]=Close[1];
 End;
 If DaysAgo<=50 and DaysAgo>0 then 
  CloseD=CloseArray[DaysAgo-1];
 If DaysAgo=0 then 
  CloseD=Close;
End;

{ Forcing the function to series }
Value1 = CloseD[1];














  • References: