Learn how to create and receive price alert messages. Follow this practical example below of a custom VWAP indicator.
1. Create a custom indicator
To create your own custom indicator in moomoo:
- Go to Watchlist > Manage Indicators
- Craft your indicator's formula using the M language, then click Test.
- Once it's confirmed to work correctly, apply it to the chart.
Any images provided are not current and any securities or inputs shown are for illustrative purposes only and are not recommendations.
2. Use the customized indicator in Algo trading
Once you have made your custom indicator, you can apply it to your algo trading strategy.
Go to Algo > Manage Strategies > Conditions > Signal > Technical Analysis > More card
Drag the More card onto the canvas.
Choose the custom VWAP indicator you've created as the variable for comparison.
Any images provided are not current and any securities or inputs shown are for illustrative purposes only and are not recommendations.
3. Set price alerts
Now that your algo trading strategy has been updated with your custom indicator, you can set an automated price alert.
3.1 Set an alert without variables
Any images provided are not current and any securities or inputs shown are for illustrative purposes only and are not recommendations.
After setting up your algo strategy, click Run Strategy > Live Trading to run it.
You will receive an alert when the VWAP indicator meets the pre-set condition (i.e. when the VWAP is lower than the last price). You can also receive the alert message on the mobile app.
Any images provided are not current and any securities or inputs shown are for illustrative purposes only and are not recommendations.
3.2 Set an alert with variables
If you want to be notified when the 1-hour VWAP for the trigger symbol falls below a stock's last trading price, including both the VWAP and the last price in the alert message:
Follow the steps below:
1. Drag the Alert Message card onto the canvas.
2. Click the Edit button at the bottom right corner of the canvas to convert the card into a custom-coded card.
Any images provided are not current and any securities or inputs shown are for illustrative purposes only and are not recommendations.
3. Customize your alert message using the alert() function with the necessary variables.
vwap_value = vwap(symbol=self.trigger_symbol1, bar_type=BarType.H1, select=1)
last_trade_price = current_price(symbol=self.trigger_symbol1)
alert(title="", content="The VWAP is {}, which is below the last price {}".format(vwap_value, last_trade_price))
4. Your custom indicator alert is ready. You can start live trading.
When your set conditions are met, you'll receive the customized alert message on your devices.
Any app images provided are not current and any securities shown are for illustrative purposes only and is not a recommendation.
VWAP is the average price of a stock weighted by the total trading volume. VWAP is used to calculate the average price of a stock over a period of time.
Losses can happen more quickly with quant and algorithmic trading compared to other forms of trading. Trading in financial markets carries inherent risks, making effective risk management a crucial aspect of quantitative trading systems. These risks encompass various factors that can disrupt the performance of such systems, including market volatility leading to losses.
Moreover, quants face additional risks such as capital allocation, technology, and broker-related uncertainties. It's important to note that automated investment strategies do not guarantee profits or protect against losses.
The responsiveness of the trading system or app may vary due to market conditions, system performance, and other factors. Account access, real-time data, and trade execution may be affected by factors such as market volatility.