diff --git a/Niki/new.pine b/Niki/new.pine index 3d8392b..fca83a6 100644 --- a/Niki/new.pine +++ b/Niki/new.pine @@ -38,9 +38,16 @@ longPoints(pair, isInverse) => shortPoints(pair, isInverse) => -longPoints(pair, isInverse) -// Hardcode the pairs and their corresponding inverse flags -pairs = ["US30", "GOLD", "DXY", "BTCUSDT.P", syminfo.tickerid] -isInverse = [false, false, true, false, false] // Inverse for DXY +// Hardcoded pairs and their corresponding inverse flags +pairs = array.new_string(5) +array.set(pairs, 0, "US30") +array.set(pairs, 1, "GOLD") +array.set(pairs, 2, "DXY") +array.set(pairs, 3, "BTCUSDT.P") +array.set(pairs, 4, syminfo.tickerid) + +isInverse = array.new_bool(5, false) +array.set(isInverse, 2, true) // Inverse for DXY // Initialize variables for storing points var float totalLongPoints = 0 @@ -48,8 +55,8 @@ var float totalShortPoints = 0 // Calculate points for each pair for i = 0 to 4 - pair = pairs[i] - inverseFlag = isInverse[i] + pair = array.get(pairs, i) + inverseFlag = array.get(isInverse, i) totalLongPoints := totalLongPoints + longPoints(pair, inverseFlag) totalShortPoints := totalShortPoints + shortPoints(pair, inverseFlag) @@ -57,8 +64,8 @@ for i = 0 to 4 plot(totalLongPoints, title="Total Long Points", color=color.blue) plot(totalShortPoints, title="Total Short Points", color=color.orange) -// BUYING VOLUME AND SELLING VOLUME // +// BUYING VOLUME AND SELLING VOLUME buyVolume = high == low ? 0 : volume * (close - low) / (high - low) sellVolume = high == low ? 0 : volume * (high - close) / (high - low) -plot(volume, style=plot.style_columns, color=color.red, title="SELL V") // shows total volume (!) +plot(volume, style=plot.style_columns, color=color.red, title="SELL V") // shows total volume plot(buyVolume, style=plot.style_columns, color=color.teal, title="BUY V") // shows only buy volume