back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [ 69 ] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161] [162] [163] [164] [165] [166] [167] [168] [169] [170] [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205]


69

Nairn

Start Row

Date

High

Close

Volume

eiF(D7-D6>0,F6+F7,eiF(D7-D6<0,FB-E7.F6))

VACC

+G8t( (D7-C7)/{B7-C ))-0.5 2 7

+ 6* (07-06) )

eAVG(D26.D45)

(148- 6)-100/145

eWQ(D6.D45)

MADIFF

<4 - 45

eAVG(F2e.F45) [lor OBV]

( 48- 5)-10( 45

eiF(J4e-N48<O.J48-N4e.O)

OBVVX

Sign

al from row 49

®IF(L49>0#AND#L48<=0#AND#N49>-$D$3;buy\ ®IF(L49>0#AND#L48<=0.-exitS-. eiF(U9<=0«ANCWL4B>0#ANDffN49>=SDS3,-Eel-, eiF(U9<=0#AND#L48>0,-exitL-, ®IF(L49<$D$3,-exilALL-." »» 0 OBVVX DVG Signal from row 49

@IF(L49>0#AND*L48<=0«AND«N49i=$D$3 »fAND«@ABS{049)<=SE$3,"buy*, @IF(L49>0f(AND#L48<=0,-exitS-, & IF(L49<=0#AND#L48>0,»AND#N49>$DS3 #AND*@ABS{049)<=SE$3,"sell", @IF(L49<=0#AND#L48>0 exilL". @IF(L49<$D$3#AND#@ABS{049)>$E$3. exitALL-."))»)

R Mom Osc 25 (©AVG(E22£25) - @AVG(E25 E6))-1O0/©AVG{E22-E251 S Avg Mom 45 ®AVG(R26.R45) T StDevMom 45 @STD{R26.R45)

Mom Signal 45 ©IF(L45AND#L44<=0«AND#R45>=S45-$FS3T45,"buy.

@IF(L45>0#AND#L44<=0,-exitS-,

@IF(L45<=0#AND«.44>O#AND#R45>=S45-$F$3T45,seir. ©IF(L45<=0#AND#L44>O,"exitL-,")l)) 25 (E25-E6)100/E6 @AVG(V26-V45) StDevROC 45 @STD(V26V45

ROC Signal 45 ©IF, L45AND#L44<-0#AND#V45>=W45-$F$3*T45."bliy.

@IF(L45>0#AND#L44<=0.exitS". @IF(L45<=0#AND#L44>0*AND«V45>= W45-$F$3-T45 -sell- @rF(L45<=0#ANDffL44>0.-exitL-.--))))

V ROC W Asfg ROC 45

Omegas Easj Language Code

The following program code gives an example of a sjstem that uses one of eight volume measurements to filter the entrj or exit of a trade. When the input ttjpe is negative the input values are treated as an entry filter; when 11 p e is positive the values are used for an exit filter.



tPJK Volume: Create a volume filter

Copyright 1995-1996. PJKaufmar. All rights reserved.I inputs: periocl(20), ttyped), maxdn{0), fnaxdvg{0), npsdt.B), ddaysO): vars: pxCO). vx(0). KvoKO), map(O), inav{0).sdiff(0), madays(0),ma(0). (lvg{OJ. nd(0), madiff(O), avgv(O). sdv(O). tentry(O), avg2(0), type<0), sc(0). avghKO), stgntiUO); (Exit type -1, On-Balance Volume

-2, Ctiiaken Volume Accumulator -3, Negative Volume Index

-4, Positive Volume lrCe?(

=5, Price and Volume Trend

-6. Volume oscillator {rpsd used for exit level) -7, Volume rate of charge -8, Low volume exit For entry filter use negative type

Itest exitl type - ttype; if type < 0 then begin tentry = 1;

type - ©absvalueCttype): end;

Iprice indexl

map - @average{close,period);

if ddays < 1 then nd - 1 else nd = ddays;

If maptnd] - 0 then px = 0 else px - <nap - nap[nd])*100/iiiap[rd];

I0n-6a1ance VoluiTiei If type = 1 then begin



1f close > CloseCl] ther KMAvol - KMAvoI * volume

else if close < cIose[l] then Kvol Kvol volume;

end;

irhaikin VolLinie Accumulator 1

1f type - 2 tnen Kvol - Kvol +(((close - low) / ihigh low)) , )-2-volL.me

{Negative Volume Irdex} if type = 3 then begin

if volume < voliimeCl] then Kvol = Kvol[l] *- (close clc5e[l])*Kvol-(. !] eUe if Kvol = 0 then Kvol - volume else kvol = Kvol[l]; end;

(Positive Volume Index! 1f type 4 ther begin

if volume > volumeCl] then Kvol - KvnUl] -t (close - cl 05e[1 ] )*Kvol [l]/cl ose[l]

else if Kvol = 0 then Kvol = volume

else Kvol = Kvol[l];

erd;

IP"ice rid Volume TrerdI

if type = ther Kvol = Kvol +voluine»tclose closefl]) / closed]

(Volume oscillatorl If type 6 ther

Kvol - (@averege(volume,ddiiys)

@average(voliime,period))*100/@average(volume,ddays);

{Volume rate-of-chengel 1f type * / then begir

Kvol - 0 then Kvcl - volume;

If volumeCperiod] = 0 then Kvol = KvoUU else

Kvol - (volume - vollirae[pcrlDd])*100/volume[pˆriod];

end;

IMovlrg average of price) madays = 2*period; ma = @everage{cl05e.madays); madiff = ma - maCnd];

if type 6 or type = 9 then begin mav = {SaveragetKvol.period);

If mavcnd] - 0 ther «x - 0 else vx « (mav - mav[nd])*l(X)/inav[nd];

Sdiff - px - vx; I record divergerce only) if vx*px < 0 then dvg = sdiff else dvg = 0; If madiff > 0 ard inadUfCl] 0 then begin exitshort at market;

if tertry = 0 and (vx >= maxdn and ©absvalue(dvg) maxdvgl then

buy at market;

end;

if madiff < 0 ard madiff[U 0 then begin exitlong at market;

if tentry - 0 and (vx maxdn ard @absvalue(dvg) <- rimxdvg) then

sell at market;

end;

If vx < piexdn ard ©absvalLe{dvg) > Tnaxdvg then begin

exitlong ot market;

exitshort at market;

end; end;



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [ 69 ] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150] [151] [152] [153] [154] [155] [156] [157] [158] [159] [160] [161] [162] [163] [164] [165] [166] [167] [168] [169] [170] [171] [172] [173] [174] [175] [176] [177] [178] [179] [180] [181] [182] [183] [184] [185] [186] [187] [188] [189] [190] [191] [192] [193] [194] [195] [196] [197] [198] [199] [200] [201] [202] [203] [204] [205]