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

Re: Code Conversion



PureBytes Links

Trading Reference Links

Sorry, but I neglected to copy the initial statements. ShowMe:Pivot D as 
follows:
input: DAYSBACK(1);
var:  Avg1(0), High1(0), Low1(0), High2(0), Low2(0);
var: index(0), Havg(0), Lavg(0), Cavg(0);
var: days_back1(0), HHigh(0), LLow(0);
array: DayHigh[60](0), DayLow[60](0), DayClose[60](0);

days_back1 = DAYSBACK - 1;

{**********************************************************
	Every Calander Day Morning!!!

***********************************************************}

if Date > Date[1] then Begin

   Havg = 0;
   Lavg = 0;
   Cavg = 0;

   for index = DAYSBACK downto 2 Begin

      DayHigh[index] = DayHigh[index - 1];
      DayLow[index] = DayLow[index - 1];
      DayClose[index] = DayClose[index - 1];

      Havg = Havg + DayHigh[index];
      Lavg = Lavg + DayLow[index];
      Cavg = Cavg + DayClose[index];

   End;

   DayHigh[1] =  HHigh;
   DayLow[1] =  LLow;
   DayClose[1] = Close[1];


   Havg = (Havg + DayHigh[1])/DAYSBACK;
   Lavg = (Lavg + DayLow[1])/DAYSBACK;
   Cavg = (Cavg + DayClose[1])/DAYSBACK;

   HHigh = High;
   LLow = Low;

end; {if}

{**********************************************************
	Every Time Periord!!!

***********************************************************}

If Date = Date[1] then begin
	If High > HHigh Then HHigh = High;
	If Low < LLow Then LLow = Low;
end;

Avg1  = (Havg + Lavg + Cavg)/3;
High1 = (2*Avg1) - Lavg;
Low1  = (2*Avg1) - Havg;
High2 = Avg1 + High1 - Low1;
Low2 = Avg1 + Low1 - High1;


Value1=(Highest(high,10) + 200 points);
Value2=(Lowest(Low,10) -  200 points);

{
If High1 < Value1 and High1 > Value2 then Plot1 (High1, "High1");
If Low1 < Value1 and  Low1 > Value2 then Plot2 (Low1, "Low1");
If High2 < Value1 and High2 > Value2 then Plot3 (High2, "High2");
If Low2 < Value1 and Low2 > Value2 then Plot4 (Low2, "Low 2");
}

if Avg1 < Value1 and Avg1 > Value2 then Plot1 (Avg1, "Avg1");







>From: "phil" <zxcv@xxxxxxxxxxx>
>To: "john berentson" <shavenheads@xxxxxxxxxxx>
>Subject: Re: Code Conversion
>Date: Wed, 24 Apr 2002 18:03:42 -0400
>
>John,
>
>Would you be so kind as to look the code over for the three separate
>segments you sent. I can't get any of them to work in TS4.
>
>Thanks so much,
>
>Phil