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.
1
2
IFlow<=indicator2then
MYRSI1=RSI
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
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:
1
2
3
IFShortOnMarketAND(TRADEPRICE–CLOSE)>10THEN
myTrigger=close
EndIf
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.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.