English
Back

How to Set Alerts By Custom Indicators

To describe how to receive messages by creating custom indicators, we will use the custom indicator VWAP as an example.

1. Create custom indicators

You can create and edit the indicator by going to Watchlist > 1D Chart > Indicator Management. After that, you can click "Test" to ensure that the indicator you created is working correctly.

 

2. Use custom indicators in Algo trading

Path: moomoo for Windows > Algo > Conditions > Signal > Technical Analysis > More

You can drag the "More" card onto the canvas and select the VWAP variable as the condition for your analysis.

 

3. Set alert messages

3.1 Set alert messages without variables

Find the "Alert Message" card, drag it onto the canvas, and check "System Notice" in the Properties panel.

After that, you can start live trading. When the VWAP indicator meets the conditions, you will receive messages on all your devices whenever the VWAP indicator meets the conditions, even if you're not using your computer.

3.2 Set alert messages with variables

By clicking "Edit" at the right-bottom corner of the canvas, you can edit the code of the "Alert Message" card to customize the alert message.

For example, you can compare the 1-hour VWAP indicator of trigger symbol 1 with the latest price of Tencent. If VWAP is lower than the price, we can receive a message like "VWAP is lower than the latest price of Tencent" with the variable (the latest price of Tencent).

This example uses the "Alert" function and enters the following code: content(str(get_MyLang_indicator(indicator_name="VWAP", variable_name="VWAP", symbol=self.trigger symbol 1, params={}, bar_type=BarType.H1, select=1)) + " is lower than the latest price of Tencent" + str(current_price(Contract("HK.00700"))))

Once the trigger conditions are met, you will receive messages with variables on your devices.