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

Connect Disconnect Sound Alert - MetaTrader 5용 expert

Dark Ryd3r & Andrey Khatimlianskii
게시자:
Rajesh Kumar Nait
조회수:
1595
평가:
(6)
게시됨:
2024.01.07 21:36
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

This utility is simple example to add sound alert on connect / disconnect

Add sounds wav files inside MQL5\Files\Sounds folder

Copy the code and compile the EA Utility, the attached file has commented lines as using of #resource makes uploading impossible

//+------------------------------------------------------------------+
//|                               Connect_Disconnect_Sound_Alert.mq5 |
//|                                Copyright 2024, Rajesh Kumar Nait |
//|                  https://www.mql5.com/en/users/rajeshnait/seller |
//+------------------------------------------------------------------+
#property copyright "Copyright 2024, Rajesh Kumar Nait"
#property link      "https://www.mql5.com/en/users/rajeshnait/seller"
#property version   "1.00"
#include <Trade/TerminalInfo.mqh>

bool     first             = true;
bool     Now_IsConnected   = false;
bool     Pre_IsConnected   = true;
datetime Connect_Start = 0, Connect_Stop = 0;

CTerminalInfo terminalInfo;
//--- Sound files
#resource "\\Files\\Sounds\\CONNECTED.wav"
#resource "\\Files\\Sounds\\DISCONNECTED.wav"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
      ResetLastError();
      while ( !IsStopped() ) {
         Pre_IsConnected = Now_IsConnected;
         Now_IsConnected = terminalInfo.IsConnected();

         if ( first ) {
            Pre_IsConnected = !Now_IsConnected;
         }

         if ( Now_IsConnected != Pre_IsConnected ) {
            if ( Now_IsConnected ) {
               Connect_Start = TimeLocal();
               if ( !first ) {
                  if(!PlaySound("::Files\\Sounds\\DISCONNECTED.wav"))
                     Print("Error: ",GetLastError());
               }
               if ( IsStopped() ) {
                  break;
               }
               if(!PlaySound("::Files\\Sounds\\CONNECTED.wav"))
                  Print("Error: ",GetLastError());
            } else {
               Connect_Stop = TimeLocal();
               if ( !first ) {
                  if(!PlaySound("::Files\\Sounds\\CONNECTED.wav"))
                     Print("Error: ",GetLastError());
               }
               if ( IsStopped() ) {
                  break;
               }
               if(!PlaySound("::Files\\Sounds\\DISCONNECTED.wav"))
                  Print("Error: ",GetLastError());
            }
         }

         first = false;
         Sleep(1000);
      }
//---
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+


pivots calculation based on pine script v4 pivots calculation based on pine script v4

This is the exact conversion of pivotshigh and pivotslow functions from pine script v4 as an mql5 indicator.

Cosine distance and cosine similarity Cosine distance and cosine similarity

Calculate the cosine distance and similarity between 2 vectors . The cosine distance is 1-cosine_similarity and the cosine similarity is the dot product of two vectors by their magnitudes multiplied.

wd.Multi_ClockPrice lite! wd.Multi_ClockPrice lite!

The 'wd.Multi_ClockPrice lite!' is the lite version of 'wd.Multi_ClockPrice', providing a visual representation of server time and bid prices on the chart. It synchronizes with PC clock every seconds, allowing seamless updates even when MT5 is offline. Real-time bid prices are displayed, efficiently meeting the need for price information. Place informational labels in the specified sub-window, adjusting positions as needed.

SymbolSyncEA SymbolSyncEA

Syncs all chart symbols to symbol of the chart the EA is attached to