♥ 0 |
Hello, I want to set up an alert trigger for when the combine signals of these 3 indicators are in agreement for. I just cant seem to get the code just right to trigger the signals just right, please see blow: def rsi1 = if reference RSI(length = 14).”RSI” >= 50 then 10 else 9; def rsi2 = if reference RSI(length = 14).”RSI” < 50 then 10 else 9; def rsiDescending = rsi1 > rsi2;
def dmi1 = if DMI(length = 14).”DI+” >= DMI(length = 14).”DI-” then 8 else 7; def dmi2 = if DMI(length = 14).”DI+” < DMI(length = 14).”DI-” then 8 else 7; def dmiDescending = dmi1 > dmi2;
def sto1 = if StochasticMomentumIndex().”SMI” >= StochasticMomentumIndex().”AvgSMI” then 6 else 5; def stoDescending = sto1 > sto2;
plot trigger = rsiDescending and dmiDescending and stoDescending;
Marked as spam
|
Please log in to post questions.
You are going to have to provide more details because your code does nothing to explain what you are trying to accomplish. Which is probably why you are not getting expected results.
For example we’ll take your rsi1 and rsi2 statements. Both of these are always going to be equal. (either both will be 10 or both will be 9). The only time they will be different is when RSI equals exactly 50. Not sure you realize that. So by the time to test for rsi1 > rsi2 you have nearly zero chance of getting a result other than false.
Hello Pete, I submitted additional information, please let me know if you received it. I submitted a new answer but dont see it reflected in the thread. Thanks again.
If you provided more information using the “Post your Answer” at the bottom of the thread it was deleted and you were notified via email. That box at the bottom is reserved for new solutions to the post. Comments and additional details are provided only through the comments.
Pete,
Did the information provided help understand the use case?
Thanks for your time.