Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Rejoignez notre page de fans
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Push Notification for Opened / Closed Trades (Netting) - bibliothèque pour MetaTrader 5
- Vues:
- 1751
- Note:
- Publié:
- 2024.10.19 04:45
- Mise à jour:
- 2024.10.19 04:46
- Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur Freelance
Features
- Sends notifications for trade opens and closes
- Shows trade type (Buy/Sell) and lot size for new trades
- Displays profit/loss for closed trades
- Works in both live trading and strategy tester (sends to logs in tester)
- Monitors last 2 hours of trading history
- Prevents notification spam through basic throttling
Installation
- Add this function to your Expert Advisor (EA) or script
- Enable push notifications in your MetaTrader platform:
- Tools → Options → Notifications
- Check "Enable Push Notifications"
- Configure MetaTrader mobile app on your phone
Important Notes
- Account Compatibility:
- Designed for netting accounts
- Not suitable for hedging accounts (where multiple positions per symbol are allowed)
- If you need hedging support, a modified version would be required
- History Window:
- Monitors the last 2 hours of trading history
- Can be adjusted by changing the 7200 value (in seconds)
- Throttling:
- Prevents excessive notifications by limiting checks to once per second
- Can be removed by deleting the time check if needed
- Error Handling:
- Includes basic error checking
- Prints error messages to journal for troubleshooting
Common Issues and Solutions
- No Notifications Received:
- Verify push notifications are enabled in MT5
- Check mobile app is properly configured
- Ensure your broker allows push notifications
- Missing Trades:
- Check if the 2-hour history window is sufficient
- Increase the history window if needed (7200 seconds)
- Duplicate Notifications:
- This shouldn't occur due to built-in checks
- If it happens, verify you're not calling the function multiple times
Best Practices
- Call this function in your EA's OnTick() function
- Keep the MetaTrader mobile app installed and configured
- Test in a demo account first
- Monitor the Experts log for any error messages
Script to extract Candlesticks data from all time frames to CSV.
This MQL5 script exports candlestick data for various timeframes into a CSV file, capturing essential market information like open, high, low, and close prices. It analyzes each candlestick's characteristics, including body and wick sizes, while calculating additional metrics such as candle gaps. After processing the latest 21 bars, it notifies the user upon successful data export.
Simplest Logger class for MetaTrader 5The simplest class for logging in MetaTrader 5 with support for levels, message format, include and exclude filters on substrings.
Sample pine script stochastic divergence converted to MQL5
A sample pine code converted to MQL
Economic Calendar CSVThis script saves a predefined set of economic events from the MetaTrader's built-in economic calendar into CSV file.