PureBytes Links
Trading Reference Links
|
IT,
It is easier to show the code to interface with the DLL.
Hope this helps .... Marlowe
{
TITLE: Fuzzy Logic Peak/Valley
TYPE: TS/SC
PURPOSE: Develop a trading system that utilizes Fuzzy
Logic
}
Inputs: Span(3), fl(12), Trigh(1.75), Trigl(0), Output(0);
Vars: pr(0), vr(0), pk(0), vk(0),
hbar(0), prn(0), vrn(0), vlt(0), dum(0);
DefineDLLFunc: "c:\msvc\fuzzy\fuzzy.dll",float,"hbar_fn",float, float;
DefineDLLFunc: "c:\msvc\fuzzy\fuzzy.dll",int,"set_fl",float;
IF (BarNumber = 1) THEN dum = set_fl(fl);
{Determine Peak and Valley rates}
pk = Peak(Span);
vk = Valley(Span);
if((pk[1]*pk[0] <> 0 ) AND (pk[1] <> pk[0])) THEN BEGIN
prn = pr;
pr = LinearRegSlope(pk, 2)/VolatPts(50);
END;
if((vk[1]*vk[0] <> 0 ) AND (vk[1] <> vk[0])) THEN BEGIN
vrn = vr;
vr = LinearRegSlope(vk, 2)/VolatPts(50);
END;
if( vrn <> vr) OR ( prn <> pr) THEN BEGIN
hbar=hbar_fn(pr, vr);
if( hbar[0] < -Trigh ) AND ( hbar[1] > -Trigh ) THEN Sell Tomorrow on Open;
if( hbar[0] > Trigl ) AND ( hbar[1] > Trigl )THEN ExitShort("Shex") Tomorrow
on Open;
if( hbar[0] > Trigh ) AND ( hbar[1] < Trigh ) THEN Buy Tomorrow on Open;
if( hbar[0] < -Trigl ) AND ( hbar[1] > -Trigl ) THEN ExitLong("Lnex")
Tomorrow on Open;
END;
IF Output = 1 THEN BEGIN
IncludeSystem: "MAE";
IncludeSystem: "Equity Curve Px";
END;
----- Original Message -----
From: <IndTrader2@xxxxxxx>
To: <marlowec@xxxxxxx>
Sent: Saturday, February 05, 2000 10:10 AM
Subject: Re: Rocket Science | Earl Cox Book
> Thanks for the info-
> How about one more ?? Feeling generous ???? How did you pass the inputs to
> the .dll ?? Hashnumbs (sp) or ??? I have had problems with the Hashnumbs
> thing and am desperate to get around the 64K barrier (I am obviously still
> running TS4 ) . TS2000i is apparently getting much better so perhaps that
may
> prove a viable solution.
>
> Thanks so SUPER much for the info.
>
> Brent-
>
|