Watch how to download trading robots for free
Find us on Twitter!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Scripts

Collect Data (Date, Time and Close Price) - script for MetaTrader 5

Views:
1235
Rating:
(2)
Published:
2025.02.15 20:08
Updated:
2025.02.19 09:51
GrabCloses.mq5 (3.9 KB) view
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

As you can see this is a short script used to collect close price and place it in a column after a date string and a time (hour and minute) string.

The data is saved to a comma separated values (CSV) file in the MQL5/Files folder by default, for outside use as needed.

There are no frills, bells or whistles on this and I am not yet familiar enough to know whether it would be better (or if it is possible) to use CopyTime and CopyRates built-in functions rather than the iClose and iTime functions. 

There are more than one ways to skin a cat as they say.

Print massive information (PrintXYZ) from the terminal Print massive information (PrintXYZ) from the terminal

PrintXYZ() library to print massive information from the terminal.

A 3 line script that tells you how many bars are on your chart A 3 line script that tells you how many bars are on your chart

A script which when dragged onto the chart will print out in the experts window the number of bars that are on that chart - like magic.

Self Optimized SMA Self Optimized SMA

The indicator plots two lines. The lower line is calculated based on the latest SMA period that caused a bounce up. The upper line is calculated based on the latest SMA period that caused a bounce down.

Useful #define statements Useful #define statements

These are some #define statements that are useful to perform operations in your EA. You only need to assign the name of your variables at the beginning of the file, and then let the other #define statements do the work. In order to use this file, add #include <DEFINE_statements.mqh> to the first line in your EA file.