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

signal code



PureBytes Links

Trading Reference Links

Inputs: FastLen(4), MedLen(9), SlowLen(18);
Variables: FastAvg(0), MedAvg(0), SlowAvg(0);

FastAvg = AverageFC(Close, FastLen);
MedAvg = AverageFC(Close, MedLen);
SlowAvg = AverageFC(Close, SlowLen);

If CurrentBar > 1 AND (FastAvg[1] > MedAvg[1] OR MedAvg[1] > SlowAvg[1]) AND (FastAvg < MedAvg AND MedAvg < SlowAvg) Then
Sell ("MAC3") This Bar on Close;

this is a signal that comes with 2000i. Can anyone tell me why this signal will verify but will
not print any flags on the price bars when turned into a strategy? there are others
that are the same. I would like to write a signal similar that uses the linear regression instead of moving
averages. I have written one , but it too verifys but will not print any flags. that doesn't mean
it is written correctly. I will never know until I find out why this signal has problems.

below is the alert that I use on my linear regression system. I would appreciate any help I could
get at turning this into a strategy. I know I can only have a bar close strategy, but this would give me an idea if an automated system would work. thanks John
If Displace >= 0 OR CurrentBar > AbsValue(Displace) Then Begin
Plot1[Displace](LinearRegValueFC(Price, Length1, 0), "LinearReg");
plot2[Displace](LinearRegValueFC(Price, Length2, 0), "LinearReg");

plot3[Displace](LinearRegValueFC(Price, Length3, 0), "LinearReg");
plot4[Displace](LinearRegValueFC(Price, Length4, 0), "LinearReg");

IF plot2 > PLOT4 AND PLOT1 crosses under PLOT2 then
ALERT ("PULLBACK LONG ")


ELSE

IF plot2 < PLOT4 AND PLOT1 crosses over PLOT2 then
ALERT ("PULLBACK SHORT ");

END;



I know this is sloppy but it is 1 of several, and it works!