Code issue with a new indicator

Forums ProRealTime English forum ProRealTime platform support Code issue with a new indicator

Viewing 3 posts - 1 through 3 (of 3 total)
  • #242979

    hello, i am trying to create this indicator but this part of the code is not recognized => “Plot1(HighJump, “High Jump”, color.red)”

    any idea anyone? thanks

    // High Jump Indicator
    // Calculates the percentage distances from the high price to the 17, 50, and 200 day moving averages.

    period17 = 17
    period50 = 50
    period200 = 200

    // Calculate the moving averages
    MA17 = Average[period17](Close)
    MA50 = Average[period50](Close)
    MA200 = Average[period200](Close)

    // Calculate the percentage distance from the high price to each moving average
    dist17 = (High – MA17) / MA17 * 100
    dist50 = (High – MA50) / MA50 * 100
    dist200 = (High – MA200) / MA200 * 100

    // High Jump Indicator is the sum of the distances
    HighJump = dist17 + dist50 + dist200

    // Plot the High Jump Indicator (using Plot1)
    Plot1(HighJump, “High Jump”, color.red)

    // Optionally, you can add a threshold line to indicate when the stock might be over-extended
    threshold = 10 // Example threshold for caution flag
    Plot2(threshold, “Threshold”, color.green)

    #242986

    Hi. You are using language not allowed in probuilder.
    To draw an indicator you have to write it in a last line starting with RETURN.

    #243039

    Makes sense
    thanks very much for this

    Fred

Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login