Introduction
Common Scenarios
How to build a strategy as a newbie
How to Use Global Variables
How to recover the original strategies
How to handle exceptions in strategy running
How to identify the problems in a strategy
How to Set Alerts By Custom Indicators
Running Order of Conditions Cards & Operations Cards
How to Determine Buying Power
How to use the trigger symbol
How to Set Trigger Conditions to Run a Strategy
How to Open and Close Positions
How to avoid repeated opening of positions
How to trade options with Algo
Card Description
Backtest
To describe how to receive messages by creating custom indicators, we will use the custom indicator VWAP as an example.
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.
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.
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.
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.