거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
조회수:
3765
평가:
(28)
게시됨:
2013.03.27 14:46
업데이트됨:
2016.11.22 07:32
이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동

The script is a simple example of using functions for search and work with files and directories.

This script searches and displays names of all files and directories to the "Experts" folder which are located in the terminal local folder. The terminal local folder location can be obtained calling the TerminalInfoString() function.

PrintFormat("The path to the terminal local folder: %s\\Files\\",TerminalInfoString(TERMINAL_DATA_PATH));

The script uses the useful property of the FileIsExist() function to find the directories. If the name of the current directory in the function parameter is specified, the function will return "false", and the _LastError variable will log an error 5018 - "This is not a file, this is a directory".

You can find more information about the description of the FileFindFirst(), FileFindNext() and FileFindClose() functions in the Help.

Code:

void OnStart()
  {
   string file_name;
   int    i=1;
//--- receive search handle in local folders' root
   long search_handle=FileFindFirst(InpFilter,file_name);
//--- check if FileFindFirst() function executed successfully
   if(search_handle!=INVALID_HANDLE)
     {
      //--- check if the passed strings are file or directory names in the loop
      do
        {
         ResetLastError();
         //--- if this is a file, the function will return true, if it is a directory, the function will generate error
         FileIsExist(file_name);
         PrintFormat("%d : %s name = %s",i,GetLastError()==5018 ? "Directory" : "File",file_name);
         i++;
        }
      while(FileFindNext(search_handle,file_name));
      //--- close search handle
      FileFindClose(search_handle);
     }
   else
      Print("Files not found!");
  }

MetaQuotes Ltd에서 러시아어로 번역함.
원본 코드: https://www.mql5.com/ru/code/1609

FigurelliSeries FigurelliSeries

The indicator allows defining the trend direction

CCIArrows CCIArrows

The semaphore signal indicator fixing moments of breakthrough of the zero level by the iCCI technical indicator and displaying these moments by color points

Demo_FileCopy Demo_FileCopy

The script demonstrates the example of using the FileCopy() function

Demo_FileDelete Demo_FileDelete

The script demonstrates the example of using the FileDelete() function