[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple Alerts in Indicators



PureBytes Links

Trading Reference Links

Hi all,

Scratching my head about an issue I'm encountering with multiple Alerts in a
single Indicator intraday.

Let's say I'm using flags as toggles:

Flag1 = Blah>Blah[4] and Blech[4]<Blech;
Flag2 = Blech>Blech[1] and Blimey<Blah;
Flag3 = BiteMe[1]>Blah[2];

Now, assume that the indicator is updated on a tick by tick basis. At any
one tick, Flag1 and Flag3 might both be True.

I had coded an Alert as follows in order to have only one toggle be able to
generate an Alert at one time:

If Flag1 then Alert ("Your zipper is down") else
If Flag2 then Alert ("Your zipper is caught") else
If Flag3 then Alert ("You need to go to Emergency");

In this case, even with the else statements, only the Alert triggered by
Flag3 will trigger. The Flag1 Alert never triggers. It's as if only the last
True Alert counts, even if nested within If Else statements. My reading of
the manual led me to believe that else conditions could isolate the Alerts.

If this is not the case, does anyone have a workaround?

In my actual code I have 8 flags I'm trying to track, and I have specific
reasons to want this tracked as an Indicator instead of a System.

Your help is much appreciated... and I DID look under my desk this time...
;~)

Best regards,

Gene Pope








  • References: