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

Compression EL



PureBytes Links

Trading Reference Links


After much searching and writing code I was unable to find an easy way to return
multiple time frame data in the easy language functions. I was able to create
this from several other ideas it seems to work. I wanted to send it to everyone
to try as we are always trying to trade multiple time frames and its not easy to
code. The data2 solution only works on one chart at a time and cannot be used as
a scan, or back tested on multiple data sets easily. It's rather large so I'll
try posting the ela separately. This is the text. Perhaps someone more fluent
than I can improve on it.


{This function is returning a compressed close it contains notes and values  for
creating Compressed H,L,and O as well a numeric input to allow different
compression ex. 2 = 2 bars, 5 = weekly 20 = monthly It will function on daily as
well as interday data. This allows us to create indicators and systems in
multiple time frames. }



Input:Compress(NumericSimple);
Vars:CompH(H),CompL(L),CompO(O),CompC(C),Length(0);
Array:Chart[4,1500](0);

Length = IntPortion(CurrentBar / Compress);
If Length > 1500 then Length = 1500;

If Length <=1500  then begin

If Value1 <= Compress then begin
   Value1 = Value1 + 1;
   If Value1 = 1 then begin
       CompO = O;
       CompH = H;
       CompL = L;
   End;
   If H > CompH then CompH = H;
   If L < CompL then CompL = L;
End;

If Value1 = Compress then begin
   CompC = C;
   Value1 = 0;
   For Value2 = Length downto 1 begin
       Chart[1,Value2] = Chart[1,Value2 - 1];
       Chart[2,Value2] = Chart[2,Value2 - 1];
       Chart[3,Value2] = Chart[3,Value2 - 1];
       Chart[4,Value2] = Chart[4,Value2 - 1];
   End;
   Chart[1,0] = CompO; {used to create CompressedOpen}
   Chart[2,0] = CompH; {used to create CompressedHigh}
   Chart[3,0] = CompL;  {used to create CompressedLow}
   Chart[4,0] = CompC; {Used to create CompressedClose}
End;   
        CompressedClose = Chart[4,0];
end;



"The darkest hour in any man's life is when he sits down to plan
 how to get money without earning it"

Sentinel Trading
rjbiii@xxxxxxxxx