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

Re: [amibroker] Re: TD Pressure Ratio Indicator



PureBytes Links

Trading Reference Links

I agree, except he indicates that gaps of greater than
15% need a different treatment.

Here, for those interested is what I coded 

_SECTION_BEGIN("TD Pressure Ratio");
Periods = Param("Periods",13,1,50,1);
function TDPressure (Periods)
{
for( i = 2; i < BarCount; i++ ) 

{
if((O[i] - C[i-1]) / C[i-1] > 0.15) // gapup
{
  BP[i] = (H[i] - C[i-1] + C[i] - L[i]) * V[i];
 }
  else if((C[i-1]-O[i]) / O[i] > 0.15)// gapdown
 {
  SP[i] = (C[i-1] - L[i] + H[i] - C[i]) * V[i];
 }
 else 
  {
  BP[i] = IIf(C[i] > O[i], C[i] - O[i],0) * V[i];
  SP[i] = IIf(C[i] < O[i], C[i] - O[i],0) * V[i];
}
}
Result = 100 *Sum(BP,Periods)/ (Sum(BP,Periods) -
Sum(SP,Periods));
Result = IIf(Result < 0,0,Result);
Result = IIf(Result > 100,100,Result);
return Result;
}

TDP = TDPressure(Periods);
Plot(TDP ,"TD Pressure",colorWhite,1);
PlotGrid(100);
PlotGrid(25,colorGreen);
PlotGrid(75,colorRed);

_SECTION_END();


--- Thomas Ludwig <Thomas.Ludwig@xxxxxx> wrote:

> > I think "up" and "down" should be C - O.  Up would
> then be positive
> > (+) differences while "down" would be negative (-)
> differences.
> 
> Well, everything I know about this indicator is what
> you wrote in your 
> posting.
> >
> > The rest of your AFL makes sense to me.  How would
> you incorporate the
> > above into your AFL?  Is IIF required?
> 
> You could change the code this way:
> 
> ...
> up=IIf(C>O,C-O,0);
> down=IIf(C<O,O-C,0);
> ...
> 
> HTH.
> 
> Greetings, Thomas
> >
> > The rest of your AFL makes sense to me.  How would
> you incorporate the
> > above into your AFL?  Is IIF required?
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, Thomas Ludwig
> <Thomas.Ludwig@xxx> wrote:
> > > Dave,
> > >
> > > perhaps something like this:
> > >
> > > Days=Param("Days",10,1,50,1);
> > >
> > > up=C>O;
> > > down=C<O;
> > > BP=Sum(up*V,Days);
> > > SP=Sum(down*V,Days);
> > >
> > > PI=100*BP/(BP+SP);
> > > Plot(PI,"Pressure Indicator",
> colorRed,styleLine);
> > >
> > > Greetings,
> > >
> > > Thomas
> > >
> > > > In the July issue of Active Trader, Tom DeMark
> discussed his TD
> > > > Pressure Ratio indicator.  Has anyone created
> the AFL for this
> > > > indicator?  Can you post the code?
> > > >
> > > > Here's a description of the indicator:
> > > >
> > > > <from AT Mag>
> > > > Numerator is the sum of all the accumulation
> (days the close was above
> > > > the open) over a certain number of days,
> multiplied by the volume -
> > > > that is the "Buying Pressure".
> > > >
> > > > Note: "Selling Pressure" is the sum of all of
> the distribution over
> > > > the same number of days, multiplied by the
> volume.
> > > >
> > > > Denominator is the absolute value of the sum
> of the Buying Pressure
> > > > and Selling Pressure.
> > > >
> > > > The ratio gives you a measure of the Buying
> Pressure as a percentage
> > > > of the total activity.  This ratio
> (oscillator) should fluctuate from
> > > > 0 to 100.
> > > > </from AT Mag>
> > > >
> > > > He also discusses creating a cumulative
> version of the Pressure Ratio,
> > > > similar to OBV.
> > > >
> > > >
> > > >
> > > > Please note that this group is for discussion
> between users only.
> > > >
> > > > To get support from AmiBroker please send an
> e-mail directly to
> > > > SUPPORT {at} amibroker.com
> > > >
> > > > For NEW RELEASE ANNOUNCEMENTS and other news
> always check DEVLOG:
> > > > http://www.amibroker.com/devlog/
> > > >
> > > > For other support material please check also:
> > > > http://www.amibroker.com/support.html
> > > >
> > > > Yahoo! Groups Links
> >
> > Please note that this group is for discussion
> between users only.
> >
> > To get support from AmiBroker please send an
> e-mail directly to
> > SUPPORT {at} amibroker.com
> >
> > For NEW RELEASE ANNOUNCEMENTS and other news
> always check DEVLOG:
> > http://www.amibroker.com/devlog/
> >
> > For other support material please check also:
> > http://www.amibroker.com/support.html
> >
> > Yahoo! Groups Links
> >
> >
> >
> 
> 


Rick Osborn 



Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/