mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-24 13:38:05 +00:00
SIMD Refactor: Merge simd-dev into dev (#55)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat> Co-authored-by: Warp <agent@warp.dev>
This commit is contained in:
co-authored by
Claude Opus 4.5
aider
Warp
parent
5bcdf8d614
commit
86fe32a682
@@ -0,0 +1,27 @@
|
||||
// The MIT License (MIT)
|
||||
// © mihakralj
|
||||
//@version=6
|
||||
indicator("Positive Volume Index (PVI)", "PVI", overlay=false)
|
||||
|
||||
//@function Calculates Positive Volume Index, tracks price changes on days with higher volume
|
||||
//@doc https://github.com/mihakralj/pinescript/blob/main/indicators/volume/pvi.md
|
||||
//@param src Price series to use for calculation
|
||||
//@param vol Volume series
|
||||
//@param start_value Starting value for PVI (typically 100 or 1000)
|
||||
//@returns float The PVI value
|
||||
pvi(series float src, series float vol = volume, simple float start_value = 100.0) =>
|
||||
var float pvi_value = start_value
|
||||
if not (na(src) or na(vol) or na(src[1]) or na(vol[1]) or src[1] == 0.0 or vol[1] <= 0.0) and vol > vol[1]
|
||||
pvi_value := pvi_value * src / src[1]
|
||||
pvi_value
|
||||
|
||||
// ---------- Main Calculation ----------
|
||||
|
||||
// Parameters
|
||||
src = input.source(close, "Price Source")
|
||||
|
||||
// Calculations
|
||||
pvi_line = pvi(src, volume)
|
||||
|
||||
// Plot
|
||||
plot(pvi_line, "PVI", color=color.yellow, linewidth=2)
|
||||
Reference in New Issue
Block a user