I modified the build in RSI to include an alarm but it rings all the time could somebody look at it and tell me what is wrong
Announcement
Collapse
No announcement yet.
Trying to put alarm on RSI
Collapse
X
-
richbois
There are several errors in the script
1. When you have a condition that needs to execute more than one command these need to be enclosed in brackets { } as in the following example
if(mycondition==true){
execute this command;
execute this command;
etc;
}
2. vFlag needs to be declared as a global variable (ie outside of main) and set initially to false
3. In your condition you need to add a check for vFlag == false otherwise the alerts will keep triggering so long as the condition is true.
4. The condition is written incorrectly as it should be == and not just =
5. You will probably need to review the condition that triggers the alert as I doubt there will be many instances in which the RSI will be exactly equal to the Breakout value
Alex
-
Originally posted by Alexis C. Montenegro
richbois
There are several errors in the script
1. When you have a condition that needs to execute more than one command these need to be enclosed in brackets { } as in the following example
if(mycondition==true){
execute this command;
execute this command;
etc;
}
2. vFlag needs to be declared as a global variable (ie outside of main) and set initially to false
3. In your condition you need to add a check for vFlag == false otherwise the alerts will keep triggering so long as the condition is true.
4. The condition is written incorrectly as it should be == and not just =
5. You will probably need to review the condition that triggers the alert as I doubt there will be many instances in which the RSI will be exactly equal to the Breakout value
Alex
ok thanks I modified it to incorporate your suggestions and its working except that once alarm triggered it never stops untin RSI gets below or above the set values
could you look at it again pleaseAttached Files
Comment
Comment