I need a script or indicator that records the Bid, Ask, Bid-Ask Spread, and Current Price of any user-specified currency pair over a recurring interval into a comma delimited file (CSV). The Bid-Ask Spread = Ask Price - Bid Price.
The script/indicator will have the following parameters:
Symbol (default: EURUSD)
Interval (default: 5000 milliseconds)
FileNameToSave: (default: symbol_data.csv)
The CSV file will have this format:
Symbol, Bid Price, Ask Price, Bid-Ask Spread, Current Price
The script/indicator records the data while it is running, but it will close and save the CSV file when the script/indicator execution is stopped.