PureBytes Links
Trading Reference Links
|
At 12:51 AM -0600 3/28/02, Ernie Bonugli wrote:
>The same OddBall code, data, TS6 version, yields different results on two
>different machines!!! Oddball on the new system yields 169 trades
>while on the old system had 203 trades.
>
>Why!!!?!
At 8:52 AM -0600 3/28/02, Ernie Bonugli wrote:
>Leave it to ranmdonness!!
Welcome to the world of "random trades with TradeStation". It adds a
little of the Las Vega appeal to trading!
Check your data with the attached version of OddBall. It will print
all errors to the debug log.
Typically about 2% of the bars will show errors. These give spurious
values to the rate-of-change calculation - sometimes good, sometimes
bad...
I will post the ELA file in the next message to hopefully keep under
the message size limit.
Bob Fulks
{ *******************************************************************
System : bf.OddBall.DataTest
Last Edit : 3/28/02
Provided By : Bob Fulks
Description : This system executes the original OddBall system
and logs data errors to the Debug log.
Data1 is the market being traded.
Data2 is the number of advancing issues on the NYSE.
Use 60 minute natural hour bars day session only.
Inputs:
RL - Lookback in bars (Default = 7)
BZ - BuyZone as in original version (Default = 3)
SZ - SellZone as in original version (Default = 1)
StrtDate - First date to start trades in Omega date format.
For example, 990224 would start trades on 2/24/99.
This is useful for assuring consistent testing with
different bar compressions to begin trades on the
same day. The MaxBarsBack interval would affect the
date trading started without this input.
PrntMode - PrntMode = 0 for no printing, 1 to print errors
© 2002 Bob Fulks, All rights reserved.
********************************************************************}
Input: RL(7), BZ(3), SZ(1), PrntMode(1), StrtDate(980101);
Vars: ADV(Close of data2), ROC(0), GoodBar(FALSE), Err(" "), TradeOK(FALSE),
DCount(0), j(0), k(RL), LDate1(0), LDate2(0);
ADV = Close of data2; {Data series for advances}
GoodBar = Date data1 = Date data2 and Time data1 = 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] data1; {Save previous dates}
LDate2 = Date[1] data2;
end;
ROC = RateOfChange(ADV, k);
if GoodBar = FALSE or Date[k] <> LDate1 or Time[k] <> Time or ADV[k] = 0 then
Err = bf.OddBall.Err(GoodBar, j, k, DCount, LDate1, LDate2, PrntMode);
end;
{--------------------System Code--------------------}
if TradeOK then begin
if ROC > BZ then Buy this bar on Close;
if ROC < SZ then Sell this bar on Close;
end;
{------------------Indicator Code--------------------}
{
if TradeOK then begin
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--------------------}
{ *******************************************************************
Function : bf.OddBall.Err
Last Edit : 3/28/02
Provided By : Bob Fulks
Description : This function logs data errors to the Debug log.
© 2002 Bob Fulks, All rights reserved.
********************************************************************}
Input: GoodBar(TrueFalseSeries), j(NumericSeries), k(NumericSeries),
DCount(NumericSeries), LDate1(NumericSeries), LDate2(NumericSeries),
PrntMode(NumericSimple);
Vars: cTime(0), cDate(0), ErrCnt(0), Err(""), Init(TRUE);
if Init then begin {Print headers once at beginning}
if PrntMode = 1 then
Print("Count", " Days", " ---Cursor--", " CurrentBar1", " CurrentBar2",
" --RefBar1--", " --RefBar2--", " LDate1", " LDate2", " j",
" k", " Error");
Init = FALSE; {Will print twice if bar of data1 missing on this bar}
end;
Err = " "; {Initialize Err on each bar}
if GoodBar then begin {Chart date and time OK}
cDate = Date;
cTime = Time;
end else begin
if Date > Date data2 or (Date = Date data2 and Time > Time data2) then begin
cTime = Time;
cDate = Date;
Err = Err + " B2"; {Bar of data2 missing}
end else
if Date data2 > Date or (Date data2 = Date and Time data2 > Time) then begin
cTime = Time data2;
cDate = Date data2;
Err = Err + " B1"; {Bar of data1 missing}
end else Err = Err + " X"; {Other error}
end;
if k = 0 then Err = Err + " k"; {Time didn't change - missing data bar}
if Close[k] data2 = 0 then Err = Err + " Z"; {Zero devisor in ROC calculation}
if Date[k] data1 <> LDate1 and
Date[k] data2 <> LDate2 then Err = Err + " D" else {Date[k] data1 and data2 bad}
if Date[k] data1 <> LDate1 then Err = Err + " D1" else {Date[k] data1 bad}
if Date[k] data2 <> LDate2 then Err = Err + " D2"; {Date[k] data2 bad}
if Time[k] data1 <> Time and
Time[k] data2 <> Time data2 then Err = Err + " T" else {Time[k] data1 and data2 bad}
if Time[k] data1 <> Time then Err = Err + " T1" else {Time[k] data1 bad}
if Time[k] data2 <> Time data2 then Err = Err + " T2"; {Time[k] data2 bad}
ErrCnt = ErrCnt + 1; {Count and print errors}
if PrntMode = 1 then
Print(ErrCnt:5:0, DCount:5:0, cDate:9:0, cTime:5:0, Date data1:9:0, Time data1:5:0,
Date data2:9:0, Time data2:5:0, Date[k] data1:9:0, Time[k] data1:5:0,
Date[k] data2:9:0, Time[k] data2:5:0, LDate1:9:0, LDate2:9:0, j:4:0, k:4:0, Err);
bf.OddBall.Err = Err; {Return text string}
|