Require specified condition before triggering alert


Hey pete,

is there a way to set up a study alert chronologically, where one condition has to hit first before another in order to trigger? instead of doing it simultaneously

Marked as spam
Posted by (Questions: 5, Answers: 2)
Asked on August 26, 2020 3:19 pm
Private answer

There is no blanket solution for this. You need to provide all the details before we can provide a solution. This cannot be done through any user settings. It must be written directly into the code and the method to accomplish this is going to be unique to every set of conditions you want to use.

Since you did not include any details at all the best I can offer is a very generic example:

def conditionOne = close > open;
def conditionTwo = close < open;
plot trigger = conditionOne within 10 bars ago and conditionTwo;

Notice there is no "chronological" component to this solution. Your question title was updated to correctly describe the context of your request.

Marked as spam
Posted by (Questions: 38, Answers: 3345)
Answered on August 26, 2020 5:43 pm