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

volume indicator assistance please



PureBytes Links

Trading Reference Links

I could use some ela coding assistance please.

I am trying to develop a volume indicator that would do 2 things.

a. every time a certain volume of a stock (lets say as a variable 1,000,000 share) turns over a show me indicator would be marked on the chart (show me).
b. the volume between those points could be shown in a histogram starting at 0 and going to 100% (indicator).

I think my problem is in my counter and defining when volume = volvariable.  Since I need this to reset every time vol = volvariable.

Here is what I have can some of you please help me learn how to write this code.

Thanks
Sno

Inputs: VolVal(10000000), StrtDate(0), ExtRgt("True");
Vars: VolCalc(0), BarCount(0), HiCalc(0), Failure(False);

IF Date = StrtDate OR (Date = LastCalcDate AND StrtDate = 0) Then Begin
    BarCount = 0;
    Failure = False;
    While VolCalc < volVal AND Failure = False Begin
        IF BarCount > MaxBarsBack Then Begin
            Failure = True;
            VolCalc = Volume[BarCount+10];
        End;
        VolCalc = VolCalc + Volume[BarCount];
        BarCount = BarCount + 1;
                
    End;
    
    Plot1[BarCount](High[BarCount]*1.01, "volvar");