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

OBall variation


  • To: <omega-list@xxxxxxxxxx>
  • Subject: OBall variation
  • From: "spi" <spi@xxxxxxxx>
  • Date: Sat, 23 Mar 2002 23:54:37 -0800
  • In-reply-to: <200203240104.RAA27047@xxxxxxxxxxxxxx>

PureBytes Links

Trading Reference Links

Have fun... long time ago we looked at several different variations of an
opening filter utilizing AD/Decl, SPF/SPX and Tick.. went to many different
levels thereafter. this code does some creative things for you as u will see
within code; primarily interested in directional leading and not exiting at
the time this was written
{PURPOSE: To test idea on TNAD

REQUIREMENTS:
   Multidata chart exactly as shown:
   Data1 = SP    1-min    Can ONLY trade data1 in system
   Data2 = NYSE TICK  1 -min
   Data3 = SP   15-min
   Data4 = NYSE TICK 15-min
   Data5 = @NA   15-min
   Data6 = @ND   15-min

AUTHOR:  South Pacific Investments

RIGHTS: All rights reserved by author.
DISCLAIMER: Neither author nor developer make any expressed or implied
claims as
    to the fitness, reliability, or accuracy of this program.  This program
can be used
    at the sole risk of the user.   User has an expressed duty to evaluate
the fitness
                  and results of this program and only use
   upon a thorough and complete understanding of the program code.
DATE:  August 3, 1998
LAST MODIFIED:  Rewrite to TNAD v. 5

INPUT DEFINITIONS:
Dir_Flag :  +1 means TICK gave "Buy OK" signal
    -1 means TICK gave "Sell OK" signal
    0 means TICK gave NO signal. Ignore all buy and sells.
HoldBars : Hold position for this number of 1-MINUTE bars, then exit.
}

Inputs: AdvOnly(False);{ This "sub-system" references TICK and @NA ONLY }
Inputs: Tnad(False);{ This sub-system references TICK, @NA AND @ND }
INPUTS: HoldBars( 75 );
VARS: Dir_Flag(0);

{The "TNADM"(TNAD plus M for minute!) System asks:
1. Is the 1 minute Tick bar or are consequtive 1 minute Bars Closing DOWN?
2. If they have, then take ONLY TNAD DOWN system signals.

3. Is the 1 minute Tick bar or are consequtive 1 minute bars CLOSING UP?
4. IF so, then take only UP TNAD system signals.}

{ Check TICK for UP or DOWN closing on 1st bar, intrabar }
IF Time = 931 THEN BEGIN
 Dir_Flag = 0;
 IF C of Data2 > O of Data2 Then Dir_Flag = +1
 Else IF C of Data2 < O of Data2 Then Dir_Flag = -1;
End;
{ IF no TICK signal, then check consecutive bars for signal }
IF Time <  945 AND Dir_Flag = 0 THEN BEGIN
 IF O of Data2 > C[1] of Data2 Then Dir_Flag = +1
 Else IF O of Data2 < C[1] of Data2 Then Dir_Flag = -1;
End;

{ Wait for 1st 15-min bar to form Data}
IF Time of Data3 = 945 AND Dir_Flag<>0 Then Begin { 945 }
 Value1 = Open of Data4;{Open of NYSE Tick}
 Value2 = Close of Data4;{Close of NYSE Tick}
 Condition1 = Value2 < Value1;{NYSE Tick Close < Open}
 Condition2 = Value2 > Value1;{NYSE Tick Close > Open}

 IF AdvOnly = true then begin
  Value3 = Open of Data5;{Open of @NA}
  Value4 = Close of Data5;{Close of @NA}
  Condition3 = Value4 < Value3;{@NA Close < Open}
  Condition4 = Value4 > Value3;{@NA Close > Open}

  IF (Condition1 AND Condition3) then SELL;
  IF (Condition2 AND Condition4) then BUY;
 End;

 IF Tnad = True then begin
  Value5 = Close of Data5 - Close of Data6;{@NA - @ND}
  Condition5 = Value5[0] < Value5[1];{@NA -@xx currentbar < value of one bar
ago}
  Condition6 = Value5[0] > Value5[1];{ value of this bar > value of one bar
ago}

  IF (Condition1 AND Condition5) then SELL at open;{Are Tick & @NA-@xx
MINUS?}
  IF (Condition2 AND COndition6) then BUY at open;{Are Tick & @NA-@xx PLUS?}

  Print(Date, Time, Dir_Flag, Condition1, condition2, condition5,
condition6 );
  { Reset Dir_Flag so it can trade again next day }
  Dir_Flag = 0;
 End;
End; { 945 }

{EXIT RULES: exit either long or short next bar close, or next next bar
close, or next, next, next bar close... etc}
{ Have Z 1-MINUTE bars passed since entry? }
IF BarsSinceEntry(0)=HoldBars Then Begin
 ExitLong;
 ExitShort;
End;