Code for setting a value at a certain point

Forums ProRealTime English forum ProOrder support Code for setting a value at a certain point

Viewing 6 posts - 1 through 6 (of 6 total)
  • #65118

    Hi

    I am trying to code in come divergence. I have an indicator that draws the low and high of the last 25 candles, I want to record the value of the RSI at whatever candle it happened the first time and then compare the RSI with when the price breaks that level.

    I tried this but it resets MYRSI1 to the value where the priced dropped below the line again(indicator2 in the low line)

    Lets say the market makes a low at candle 15. I want to save the RSI value at the point. On candle 30 it breaks the low, I then want to compare the current RSI value to the one saved at candle 15

    #65183
    #65253

    Thanks Grahal. Eventually figured it out. Wrote an indicator and works great.

    1 user thanked author for this post.
    #115279
    VN

    Hi Grahal, I have a similar objective to Louwrens, but I am trying to record the price (the closing price) once an event takes place and then I want to go back and reference that price.

    Example:

    But I only want the “myTrigger” variable to be updated only once such that on the next candle if the TRADEPRICE – CLOSE becomes 11, I don’t want to record the price. I only want the variable “myTrigger” to be updated with the closing price the first and only time the (TRADEPRICE – CLOSE ) > 10 condition is met.

    Do you know is there a way this can be done?

    #115284

    >> For clarity of messages on ProRealCode’s forums, please use the “insert code PRT” button to separate the text of the code part! Thank you! <<
    🙂

    #115285

    You can make a test to know if you have already updated the variable for that specific order: (by using TRADEINDEX)

    (not tested).

    1 user thanked author for this post.
Viewing 6 posts - 1 through 6 (of 6 total)

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