I'm trying to create an indicator that will work like the "pressure"
indicator in QuoteTracker, i.e. display the trend in shares selling
at the bid or ask.  Here is what I tried, with the idea of
accumulating each trade and then displaying it on a one-minute chart,
but it doesn't work the way I intended.  I have to believe somebody
else has written the code for this kind of thing, but I didn't find it
in the library.  Any ideas?  TIA

p=Param("Smoothing Period",10,2,200,1);
Cumnv=0;
bd=GetRTData("bid");
ak=GetRTData("ask");
Lp=GetRTData("Last");
tv=GetRTData("tradevolume");
Ct=GetRTData("ChangeTime");
nv=IIf(Lp=ak,tv,IIf(Lp=ak,-tv,0));
Cumnv=IIf(ct<Now(format = 4)-100,Cumnv+nv,nv);
pressure=MA(nv,p);
Hcolor=IIf(cumnv<0,colorRed,IIf(cumnv>0,colorGreen,colorWhite));
Plot(cumnv,"Trade Vol",Hcolor,styleHistogram|styleOwnScale);
Plot(pressure,"Pressure",Hcolor);

Chuck

Reply via email to