PVI as Array

PVI returns an array containing the Positive Volume Index.

 

Example:

' This is a system based on the PVI indicator.
Sub Main()
  TArrPVI = PVI
  TArrMA = EMA(TArrPVI, 9)
  For CurrentBar = BeginBar to EndBar
' If MA goes above the PVI then send a Buy signal.
    If Cross(TArrMA, TArrPVI, CurrentBar) then
      Buy(CurrentBar)
    End If
' If PVI goes above its MA then send a Sell signal.
    If Cross(TArrPVI, TArrMA, CurrentBar) then
      Sell(CurrentBar)
    End If
  Next
End Sub