PureBytes Links
Trading Reference Links
|
At 12:54 PM -0800 3/25/02, david b. stanley wrote:
>something like this maybe? I'm not certain that all the system code
>could be nested this way and people with different missing bars would
>still have descrepancies but, at least, the descrepancies would be documented.
>
>if T=T of data2 and D=D of data2 then begin
> {...system code...}
>end
>else begin
> {...document missing data into file or to screen...}
>end;
You need to decide what to do with the bad bars when you are in a
trade. Do you exit? Do you hold your position, etc. I tested several
ideas and will report more later.
I basically did something similar to your code except that I was
testing original OddBall as it was including the errors. See below:
Bob Fulks
---
Input: RL(7), BZ(3), SZ(1), xMode(1), PrntMode(1), StrtDate(980101);
Vars: ADV(Close of data2), ROC(0), nTime(0), GoodBar(FALSE), Err(""), TradeOK(FALSE),
ErrCnt(0), DCount(0), j(0), k(RL), LDate1(0), LDate2(0);
ADV = Close of data2; {Data series for advances}
GoodBar = Date = Date data2 and Time = Time data2;
TradeOK = Date >= StrtDate and Time > 0930 and Time <= 1600;
if TradeOK then begin
if Date <> Date[1] then begin {New day initialization}
DCount = DCount + 1; {Count days to allow 2 days of initialization}
LDate1 = Date[1]; {Save previous date data1}
LDate2 = Date[1] data2; {Save previous date data2}
end;
if xMode = 1 then begin
ROC = RateOfChange(ADV, k);
if GoodBar = FALSE or Time[k] <> Time or ADV[k] = 0 then
Err = bf.OddBall.Err(GoodBar, j, k, DCount, LDate1, LDate2, PrntMode);
end;
{--------------------System Code--------------------}
if DCount >= 3 then begin
if ROC > BZ then Buy on Close;
if ROC < SZ then Sell on Close;
end;
end;
{------------------Indicator Code--------------------}
{
Plot1(ROC, "1"); {Plot as a line}
if Err <> " " then Plot3(ROC, "3"); {Plot as a fat Point}
Plot4(0, "4"); {Plot as a line}
end;
}
{--------------------End Code--------------------}
|