SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
Strategies & Market Trends : TA-Quotes Plus

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: Mike Hagerty who wrote (2162)10/8/1997 9:06:00 AM
From: CynicalTruth   of 11149
 
Mike....Re: "Anyone tried programming DM+ and DM- scans? Thanks."

Looked into it...major project. Might not be able to do it do to
recursive calculations. Here's the TS coding below, give it a try...

********************************************************************}
inputs: Length(NumericSimple) ;
Vars: TRange(0);

TRange = H - L;
If TRange < (H-C[1])
Then TRange = (H-C[1]);
If TRange < (C[1]-L)
Then TRange = (C[1]-L);
-------------

{ *******************************************************************

Study : DMIPlus

Last Edit : 7/7/95

Provided By : Omega Research, Inc. (c) Copyright 1995

********************************************************************}
inputs : Length (NumericSimple) ;
vars : Counter (0), TRange(0), MyRange(Length), PlusDM14(0), PlusDM(0), MinusDM(0);

if CurrentBar = 1
then begin
MyRange = Length;
DMIPlus = 0;
PlusDM14 = 0;
TRange = 0;
for Counter = 0 to MyRange-1
begin
if (High[Counter ] - High[Counter+1] < 0) then
PlusDM = 0
else
PlusDM = High[Counter ] - High[Counter+1];
if (Low [Counter+1] - Low [Counter ] < 0) then
MinusDM = 0
else
MinusDM = Low [Counter+1] - Low [Counter ];
if MinusDM >= PlusDM then
PlusDM = 0;
{ MinusDM not set to 0 because it is not used }
TRange = TRange + TrueRange[Counter] ;
PlusDM14 = PlusDM14 + PlusDM ;
end;
if (TRange <> 0) then
DMIPlus = 100 * PlusDM14 / TRange
else
DMIPlus = 0 ;
end
else if CurrentBar > 1
then begin
if High[0]-High[1] < 0 then
PlusDM = 0
else
PlusDM = High[0]-High[1];
if Low [1]-Low [0] < 0 then
MinusDM = 0
else
MinusDM = Low [1]-Low [0];
if MinusDM >= PlusDM then
PlusDM = 0;
{ MinusDM not set to 0 because it is not used }
if MyRange > 0
then begin
TRange = TRange [1] - (TRange [1] / MyRange) + TrueRange;
PlusDM14 = PlusDM14[1] - (PlusDM14[1] / MyRange) + PlusDM;
end;
if (TRange <> 0) then
DMIPlus = 100 * PlusDM14 / TRange
else
DMIPlus = 0 ;
end ;

{ *******************************************************************

Study : DMIMinus

Last Edit : 7/7/95

Provided By : Omega Research, Inc. (c) Copyright 1995

********************************************************************}
inputs : Length(NumericSimple);
var : Counter(0), TRange(0), MyRange(Length), MinusDM14(0), MinusDM(0), PlusDM(0) ;

if CurrentBar = 1
then begin
MyRange = Length ;
DMIMinus = 0 ;
MinusDM14 = 0 ;
TRange = 0 ;
for Counter = 0 to MyRange-1
begin
if (High[Counter ] - High[Counter+1] < 0) then
PlusDM = 0
else
PlusDM = High[Counter ] - High[Counter+1] ;
if (Low [Counter+1] - Low [Counter ] < 0) then
MinusDM = 0
else
MinusDM = Low [Counter+1] - Low [Counter ] ;

if PlusDM >= MinusDM then
MinusDM = 0;
{ Plus DM not set to 0 because it is not used }
TRange = TRange + TrueRange[Counter] ;
MinusDM14 = MinusDM14 + MinusDM ;
end;
if TRange <> 0 then
DMIMinus = 100 * MinusDM14 / TRange
else
DMIMinus = 0;
end
else if CurrentBar > 1
then begin
if High[0]-High[1] < 0 then
PlusDM = 0
else
PlusDM = High[0] - High[1];

if Low [1]-Low [0] < 0 then
MinusDM = 0
else
MinusDM = Low [1] - Low [0] ;

if PlusDM >= MinusDM then
MinusDM = 0 ;
{ Plus DM not set to 0 because it is not used }
if MyRange > 0
then begin
TRange = TRange [1] - (TRange [1] / MyRange) + TrueRange;
MinusDM14 = MinusDM14[1] - (MinusDM14[1] / MyRange) + MinusDM;
end;
if TRange <> 0 then
DMIMinus = 100 * MinusDM14 / TRange
else
DMIMinus = 0;
end;
*************************************************************

{ *******************************************************************

Study : DMI

Last Edit : 7/7/95

Provided By : Omega Research, Inc. (c) Copyright 1995 ********************************************************************}
inputs : Length(NumericSimple);

if DMIPlus(Length) + DMIMinus(Length) = 0 then
DMI = 0
else
DMI = 100 * AbsValue(DMIPlus(Length) - DMIMinus(Length)) / (DMIPlus(Length) + DMIMinus(Length));
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext