거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Push Notification for Opened / Closed Trades (Netting) - MetaTrader 5용 라이브러리

조회수:
2989
평가:
(4)
게시됨:
2024.10.19 04:45
업데이트됨:
2024.10.19 04:46
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

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

  1. Add this function to your Expert Advisor (EA) or script
  2. Enable push notifications in your MetaTrader platform:
    • Tools → Options → Notifications
    • Check "Enable Push Notifications"
    • Configure MetaTrader mobile app on your phone

Important Notes

  1. 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
  2. History Window:
    • Monitors the last 2 hours of trading history
    • Can be adjusted by changing the 7200 value (in seconds)
  3. Throttling:
    • Prevents excessive notifications by limiting checks to once per second
    • Can be removed by deleting the time check if needed
  4. Error Handling:
    • Includes basic error checking
    • Prints error messages to journal for troubleshooting

Common Issues and Solutions

  1. No Notifications Received:
    • Verify push notifications are enabled in MT5
    • Check mobile app is properly configured
    • Ensure your broker allows push notifications
  2. Missing Trades:
    • Check if the 2-hour history window is sufficient
    • Increase the history window if needed (7200 seconds)
  3. 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

  1. Call this function in your EA's OnTick() function
  2. Keep the MetaTrader mobile app installed and configured
  3. Test in a demo account first
  4. Monitor the Experts log for any error messages



Script to extract Candlesticks data from all time frames to CSV. 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 5 Simplest Logger class for MetaTrader 5

The simplest class for logging in MetaTrader 5 with support for levels, message format, include and exclude filters on substrings.

Sample pine script stochastic divergence Sample pine script stochastic divergence

A sample pine code converted to MQL

Economic Calendar CSV Economic Calendar CSV

This script saves a predefined set of economic events from the MetaTrader's built-in economic calendar into CSV file.