path functions.dll

path functions.dll
Download ALL MT4 scripts (422)
YouTube Video Thumbnail



Similar MetaTrader Tools

path functions.dll

Info

The path functions.dll is a Script for MetaTrader 4 that skype chat for product support:latest versions of libraries, scripts, and applications:ftp://zhunko_guest:abd4vsuc@ftp. zhunko.

Usage

This tool is typically used for enhancing chart analysis and decision making.

Platform

This Script works exclusively on MetaTrader 4 (both build 600+ and newer versions).

Setup

Place the downloaded file in MQL4/Scripts folder via File ? Open Data Folder in MetaTrader 4.


How to Install and Use path functions.dll

1. Installation: Move your script file into the MQL/Scripts directory and restart the platform.

2. Execution: Drag the script onto a chart; it will perform a one-time action, such as closing all open orders or clearing chart objects.

3. Editing: Use MetaEditor (F4) to modify code, click "Compile," and verify no errors appear in the terminal before running.

4. Removing: Scripts stop automatically, but you can remove them manually by right-clicking the chart and choosing "Remove Script."

Frequently Asked Questions

Q: How are scripts different from EAs? A: Scripts execute a single action and then stop; EAs monitor the market and trade continuously.

Q: Can I assign a hotkey to a script? A: Yes, right-click the script in the Navigator, select "Set Hotkey," and define your preferred keyboard shortcut.

Q: Why did my script stop? A: Scripts are designed to stop immediately after finishing their programmed command; this is normal behavior.

What this tool does

skype chat for product support:latest versions of libraries, scripts, and applications:ftp://zhunko_guest:abd4vsuc@ftp.

Typical Use Case

This Script excels in automated trading and technical analysis on MetaTrader 4.

Compatible Platform & Setup

This Script works on MetaTrader 4. Place the file in the MQL4/Scripts folder and restart the terminal.

Description & Settings

Related: File Functions Library (filefunctions.dll) - another powerful script for MetaTrader 4 traders.

skype chat for product support:

latest versions of libraries, scripts, and applications:

Also recommended: mt4/mt5 shortcuts extensions - similar script with strong performance on MetaTrader 4.


ftp://zhunko_guest:[email protected]

the library functions perform all possible actions with directories, including operations outside the mt4 "sandbox".

all functions handle exceptions in case of errors, helping to reduce debugging time.

the following functions support batch operations: pathcopy, pathdelete, and pathmove. paths should be passed in quotes, separated by spaces. although i haven't tried it myself, it should work.

the library only works on windows vista and above.

there are 12 functions in total:

//=========================================================================================================

// 1. checks the existence of a directory. returns true if the directory exists, otherwise false.

bool
pathcheck
w
(
string
spath);
// directory path.

//=========================================================================================================

// 2. clears the specified directory of its contents (folders and files).
// returns true if the directory is completely cleared, otherwise false. works with unicode strings.

bool
pathclearcontentsw
(
string
spath); // directory path with optional trailing slash.

//=========================================================================================================

// 3. clears the specified directory and its subdirectories of files.
// returns true if the directory is completely cleared, otherwise false. works with unicode strings.

bool
pathclearfromfilesw
(
string
spath); // directory path with optional trailing slash.

//=========================================================================================================

// 4. copies an existing directory, including its child elements. if the directory exists, it overwrites them.
// old data is destroyed. returns true if the directory is copied, otherwise false.

bool
pathcopyw
(
string
sexistingpath,
// name of the existing directory or file.

              
string
snewpath);    
// name of the new directory or file.

//=========================================================================================================

// 5. creates a directory. returns true if the directory is created or already exists, otherwise false.

bool
pathcreatew
(
string
spath);
// path to the new directory.

//=========================================================================================================

// 6. deletes any directory. returns true if the directory is deleted, otherwise false.

bool
pathdeletew
(
string
spath);
// directory path.

//=========================================================================================================

// 7. deletes an empty directory. returns true if the directory is deleted, otherwise false.

bool
pathdeleteemptyw
(
string
spath);
// directory path.

//=========================================================================================================

// 8. retrieves a list of directories and/or files into an array based on the specified path and search mask.
// returns the number of directories and/or files found. in case of an error, it throws an exception and returns -1.

int
pathgetlistw
(
string
  spath,      
// path to the directory, which may contain wildcard characters (* and ?).

                                     
// this string can specify a specific file like "c:\filename.txt" or

                                       
// can store a pattern like "c:\*.*". if a pattern is specified,

                                     
// it allows listing all files that match the pattern. if the string

                                     
// ends with a wildcard, period, or directory name, the user must have access to the root directory

                                     
// and all its subdirectories in the path.

                 
int
     nsearch,    
// search option: gl_folder - search only for directories.

                                     
//               gl_file   - search only for files.

                                     
//               gl_all    - search for directories and files.

                 
string
& aslist[],  
// one-dimensional string array to fill with file and directory names.

                                     
// array cells should have sufficient characters to receive file and directory names.

                 
int
     nsizelist);
// size of the file and directory name list array.

//=========================================================================================================

// 9. checks if a directory is empty. returns true if the directory is not empty or false
// if the directory is empty or the path is not a directory.

bool
pathisemptyw
(
string
spath);
// directory path.

//=========================================================================================================

// 10. moves (renames) an existing directory, including its child elements.
// returns true if the move is successful, otherwise false.

bool
pathmovew
(
string
sexistingpath,
// name of the existing directory or file.

              
string
snewpath);    
// name of the new directory or file.

//=========================================================================================================

// 11. creates a symbolic link for the specified directory. returns true if the symbolic link is created,
// otherwise false. throws an exception in case of an error.

bool
pathsymboliclinkw
(
string
sexistingdirectory,      
// name of the existing directory.

                       
string
ssymboliclinkdirectory);
// name of the symbolic link to the directory.

//=========================================================================================================

// 12. truncates the file name from the full path to the file and returns the directory path
// containing the input parameter. it's impossible to distinguish between a file name and a directory name.
// therefore, you must be sure that the path being processed ends with a file name.
// each function call will first truncate the file name, if present, then the next directory name, if present.

string
pathtrimnamefilew
(
string
spathfull);
// full path.

//=========================================================================================================

package:

1.
library
pathfunctions.dll
.

2.
library header file
pathfunctions.mqh
.

3.
test script with examples
check_pathfunctions.dll.mq4
.

4.
all of the above, organized into mt4 folders and archived as
pathfunctions.zip
.

tips:

examples of using the library functions can be found in the test script
check_pathfunctions.dll.mq4
.

if you have any questions about how to use the library, please ask.

if you have suggestions for improving the library, please share them.

a short video demonstrating the library's functionality using the test script.

You may also like: i-gap: Gap Trading Indicator - excellent alternative for script users on MetaTrader 4.

Source Code

#property copyright "robotfx"
#property link "https://robotfx.org"
#property show_inputs
#include <pathfunctions.mqh> //    "pathfunctions.dll"     .
input string pathtest       = "f:\\check_pathfunctions\\test0"; //   .      .
input string pathsymblink   = "f:\\check_symboliclink\\test0";  //    .      .
input bool   checkall       = false;                            //    .
input bool   check          = false;                            //  1.     pathcheck().
input bool   clearcontents  = false;                            //  2.     pathclearcontents().
input bool   clearfromfiles = false;                            //  3.     pathclearfromfiles().

.......

Leave your opinion, ask a question, share some knowledge

Limitations & Risk Warning

  • This tool is provided for educational and testing purposes only.
  • Past performance does not guarantee future results.
  • Trading involves substantial risk of loss. Use on a demo account first.
  • Results may vary depending on market conditions, broker, and settings.
  • We recommend thorough backtesting and forward testing before using with real funds.
© ROBOTFX Free educational tools by RobotFX. Use entirely at your own risk; we are not liable for any financial losses incurred.