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

Re: Daytrading volume indicator...need some help



PureBytes Links

Trading Reference Links

At 12:00 AM 9/23/2007, you wrote:

>I'd appreciate some help, I think this would be a valuable indicator for stock or futures daytraders, showing what the large traders are doing.

Here is something similar. It doesn't filter the trades by size but that should be easy to add.

This only works on a live data feed since the stored data base does not include the required data. So it starts plotting values only after it sees new data coming in, not on all the past data on the chart.

It works only on TS8.2 and later TS versions.

Bob Fulks


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

Description: This indicator calculates the sum of the number of 
             contracts traded at the ask price minus the number of 
             contracts traded at the bid price within each bar. 
             It also plots an exponential moving average of the 
             values. It only works on real-time data.

Written by:  Bob Fulks
        
Date:        08/03/07

***************************************************************************}

Input: Length(20);
        
Var: intrabarpersist LTicks(0);
Var: intrabarpersist TSize(0);
Var: intrabarpersist Sum(0);
Var: intrabarpersist LSum(0);

if LastBarOnChart then begin
   TSize = Ticks - LTicks;    // find trade size
   if Close = CurrentBid then Sum = Sum - TSize;
   if Close = CurrentAsk then Sum = Sum + TSize;
   LTicks = Ticks;            // save last value
   if BarStatus(1) = 2 then begin
      LSum = Sum;             // on last tick of bar
      Sum = 0;                // ... save value and reset
   end;
   Plot1(LSum, "Sum");
   Plot2(XAverage(LSum, Length), "Avg");
   if LSum > 0 
      then SetPlotColor(1, DarkBlue)
      else SetPlotColor(1, DarkRed);
end;