Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
947 B
2
Indexable
Never
//@version=5
indicator("3 Phase Counter", overlay = false)

currentSymbol = syminfo.tickerid
symbols = array.new_string(6)
array.set(symbols, 0, "FX:USDCAD")
array.set(symbols, 1, "FX:EURUSD")
array.set(symbols, 2, "FX:USDJPY")
array.set(symbols, 3, "FX:USDCHF")
array.set(symbols, 4, "FX:AUDUSD")
array.set(symbols, 5, "FX:GBPUSD")

dcur_vals = array.new_float(6)
array.set(dcur_vals, 0, 1)
array.set(dcur_vals, 1, 1.24)
array.set(dcur_vals, 2, 1.6)
array.set(dcur_vals, 3, 0.96)
array.set(dcur_vals, 4, 1.12)
array.set(dcur_vals, 5, 1.7)

pipm_vals = array.new_float(6)
array.set(pipm_vals, 0, 1)
array.set(pipm_vals, 1, 1)
array.set(pipm_vals, 2, 90)
array.set(pipm_vals, 3, 0.82)
array.set(pipm_vals, 4, 0.84)
array.set(pipm_vals, 5, 1.27)

dcur = 1
pipm = 1
for i = 0 to 5
    if currentSymbol == array.get(symbols, i)
        dcur := array.get(dcur_vals, i)
        pipm := array.get(pipm_vals, i)

// ... (rest of the code remains the same)