#What is a Script?
Scripts are similar to Expert Advisors, but they do something once. You can run a Script by double-click on it in the Navigator. When the Script does all its work, which normally happens in less than a second, it automatically exits. Scripts does not work on every tick, they just do whatever they are supposed to do once, as fast as possible, and then they immediately exit.
Scripts are suitable when you want to create simple trading actions like closing all your trades with a single (actually double) click. In a sense, scripts extend the interface of the terminal by adding more quick actions to it.
Here is where Scripts are located:
- For MetaTrader 4: "%Data Folder%/MQL4/Scripts/"
- For MetaTrader 5: "%Data Folder%/MQL5/Scripts/"
Put your .mq4/.ex4 or .mq5/.ex5 files in these folders.
In MetaTrader you can find your Script under Scripts in the Navigator panel.
#Events
There is only one event:
- Start - fired once when the Script starts
