ChartButton Class MT4 - MetaTrader 4 Expert - MetaTrader 4 Resources
This class allows you to create buttons on the chart as if they were chart objects (with time and price coordinates), these objects can be dragged around the chart, and they stay in the same position when scrolling. If you don't want to learn some object-oriented programming, or understand how chart events work, or create a graphical interface, you can learn a lot from it.
The main idea behind it is that it reacts to chart changes and mouse movements. If the mouse matches the given criteria, the button will be selected and can be dragged. I use custom chart event EVENT_DRAG to monitor dragging. The button's onChartEvent function is always called in the built-in OnChartEvent function and passes the information to different handler functions.
Watch a tutorial video I made that demonstrates the basic idea:
Attachment download
📎 chartbuttontest.mq4 (19.28 KB)
Source: MQL5 #44020
ChartButton Class MT4 - MetaTrader 4 Expert - MetaTrader 4 Resource Usage and Filtering Suggestions
This content can be used as a data entry for foreign exchange EA, indicators, trading systems or quantitative strategies. When reading, it is recommended to make a judgment based on the platform version, trading type, time period, risk control method and historical discussion background. Do not use it directly based on the title or a single point of view.
If the content involves MT4/MT5, ForexFactory, MQL source code, TradingView indicators or strategy discussions, you can give priority to the parameter logic, backtest environment, market stage, execution cost and failure conditions, and then decide whether to continue downloading, reviewing or secondary development.
Risk warning
For any EA, indicator or automatic trading strategy, it is recommended to first conduct historical backtesting, simulation account verification and small capital testing. Grid, Martin, high frequency, recovery and examination strategies especially require setting the account risk upper limit, single variety risk upper limit and manual deactivation conditions.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •