Login Page - Create Account

Support Board


Date/Time: Fri, 07 Feb 2025 15:03:56 +0000



Post From: Alert when price is crossing / touching a Moving average

[2022-03-18 21:47:01]
Sawtooth - Posts: 4173
will this formula applies in the color bar based on alert condition
No, because the LASTPRICE is for the current bar only, and the comparison is to the previous bar.
The Close price is actually the last price in the current bar and the closed price in previous bars.

You need to use the Close instead of the LASTPRICE:
=OR (CROSSFROMABOVE(C, ID7.SG1), CROSSFROMBELOW (C, ID7.SG1))

If 'Evaluate On Bar Close' is not checked, you'll get an alert immediately as soon as the price reaches the MA.
You will probably want to check 'Alert Only Once Per Bar'.