Initial commit: MQL5 Scripts Collection (MetaTrader 5)
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# 🚀 Unlock the Power of Trading!
|
||||
|
||||
Welcome to this open-source trading project. Here you will find powerful tools to enhance your trading journey. If you find this project useful, please consider starring ⭐, sharing, or donating to support further development!
|
||||
|
||||
---
|
||||
|
||||
**Support the project:**
|
||||
- Star this repository on GitHub
|
||||
- Share it with your trading friends
|
||||
- [Donate here](https://www.paypal.com/donate/?hosted_button_id=YOUR_BUTTON_ID) to help us grow!
|
||||
|
||||
---
|
||||

|
||||
|
||||
## Source Files
|
||||
- `demo_fileisending.mq5`
|
||||
|
||||
---
|
||||
> Made with ❤️ for the trading community.
|
||||
@@ -0,0 +1,37 @@
|
||||
//+------------------------------------------------------------------+
|
||||
//| Demo_FileIsEnding.mq5 |
|
||||
//| Copyright 2013, MetaQuotes Software Corp. |
|
||||
//| http://www.mql5.com |
|
||||
//+------------------------------------------------------------------+
|
||||
#property copyright "Copyright 2013, MetaQuotes Software Corp."
|
||||
#property link "http://www.mql5.com"
|
||||
#property version "1.00"
|
||||
//--- show the window of input parameters when launching the script
|
||||
#property script_show_inputs
|
||||
//--- input parameters
|
||||
input string InpFileName="file.txt"; // file name
|
||||
input string InpDirectoryName="Data"; // directory name
|
||||
input int InpEncodingType=FILE_ANSI; // ANSI=32 or UNICODE=64
|
||||
//+------------------------------------------------------------------+
|
||||
//| Script program start function |
|
||||
//+------------------------------------------------------------------+
|
||||
void OnStart()
|
||||
{
|
||||
//--- print the path to the file we are going to use
|
||||
PrintFormat("Working %s\\Files\\ folder",TerminalInfoString(TERMINAL_DATA_PATH));
|
||||
//--- reset the error value
|
||||
ResetLastError();
|
||||
//--- open the file for reading (if the file does not exist, the error will occur)
|
||||
int file_handle=FileOpen(InpDirectoryName+"//"+InpFileName,FILE_READ|FILE_TXT|InpEncodingType);
|
||||
if(file_handle!=INVALID_HANDLE)
|
||||
{
|
||||
//--- print the file contents
|
||||
while(!FileIsEnding(file_handle))
|
||||
Print(FileReadString(file_handle));
|
||||
//--- close the file
|
||||
FileClose(file_handle);
|
||||
}
|
||||
else
|
||||
PrintFormat("Error, code = %d",GetLastError());
|
||||
}
|
||||
//+------------------------------------------------------------------+
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
Reference in New Issue
Block a user