PureBytes Links
Trading Reference Links
|
Hi,
if a chart has more than 10000 bars, the following code would hang up
(referencing an array element which doesn't exist).
The rest seems a little suspicious for me... 2-dimensional Array for this
duty?
By the way: Array[Count_a, Count_b, ...](Initval);
What do you think about this idea? Not so nice, but more effective, I think.
{**************************************************************}
Inputs: PricTyp1(0), PricOfs1(0), PricTyp2(0), PricOfs2(0);
vars: Price1(0), Price2(0), Filtered(false);
if PricTyp1 = 0 then Price1 = Open[PricOfs1]
else if PricTyp1 = 1 then Price1 = High[PricOfs1]
else if PricTyp1 = 2 then Price1 = Low[PricOfs1]
else Price1 = Close[PricOfs1];
if PricTyp2 = 0 then Price2 = Open[PricOfs2]
else if PricTyp2 = 1 then Price2 = High[PricOfs2]
else if PricTyp2 = 2 then Price2 = Low[PricOfs2]
else Price2 = Close[PricOfs2];
Filtered = Price1 > Price2;
if Filtered = false then begin
{ Hier dann Dein Code. Nachfolgend eine Dummy-Zeile }
{DUMMY} if MarketPosition < 0 then Buy at the market else Sell at the
market;
end;
{*******************************************************}
Greetings from Konstanz,
Yann
>
> Input: ArrIncr1(1), ArrIncr2(4);
>
> Array: Price(10000,4);
>
> Price(Barnumber, 1) = Open;
> Price(Barnumber, 2) = Close;
> Price(Barnumber, 3) = High;
> Price(Barnumber, 4) = Low;
>
> If Price(Barnumber, ArrIncr1) > Price(Barnumber, ArrIncr2) then begin...
>
> If Price(Barnumber, ArrIncr1) < Price(Barnumber, ArrIncr1)[1] then
begin...
>
>
> etc.
>
>
> Something like that... then you could optimize on ArrIncr1 and ArrIncr2.
> Of course, you could get tricky and reduce your testing time by noting
that
> Price(Barnumber, 4) will never be greater than the other array values for
a
> given bar, etc. but that's not necessary if you don't mind a little extra
> testing time...
>
>
> The Omega Man
>
>
>
>
> ----- Original Message -----
> From: Volker Knapp <vk@xxxxxxxxxxxxxxxxxxxx>
> To: Mark Brown <markbrown@xxxxxxxxxxxxx>; pierre.orphelin
> <pierre.orphelin@xxxxxxxxxx>; Omega list <omega-list@xxxxxxxxxx>
> Sent: Tuesday, June 08, 1999 2:44 AM
> Subject: Filter
>
>
> > I would like to ask the list and the two experts in EL wether they have
> ant
> > idea of the following:
> >
> > I would like to test different filters for my system. The filters should
> be
> > simple, such as :
> >
> > if C > O then begin or
> > If C > C[1] then begin
> >
> > and so on.
> >
> > Sine this filters can have many variations, I am trying to get the
O,H,L,C
> > and respective O,H,L,C before as inputs, so that i can optimize them:
> >
> > Something like:
> > O=1
> > O[1] = 2
> > O[2] = 3
> >
> > So that i can say:
> >
> > If 1>2 then begin
> >
> >
> > Is there anyway to do that?
> >
> > Thanks
> >
> > Volker
> >
>
|