• 概述
  • 评论 (4)
  • 评论 (8)
  • 新特性

Excel to Orders

Why do you need this script?

If you have lots of analyzed orders in Excel where need to be placed on MT4 , this script will be very handy and time saver for you.

All your orders are processed in seconds and the your order's results are written to an output file.


How it works?

1. Prepare  .xls file and save it as

...MQL4\Files\Excel_to_Orders.csv

Input csv structure:

  1. Ref no (string) [ free format unique ref no , it is up to you. ]
  2. Symbol (string)
  3. Cmd (string) [ BUY , SELL  , BUY_LIMIT , SELL_LIMIT , BUY_STOP , SELL_STOP ]
  4. Volume (double)
  5. Price (double)
  6. Slippage (int)
  7. Stoploss (double)     0 (Zero):Means No Stoploss value 
  8. Takeprofit (double)  (Zero):Means No Takeprofit value 
  9. Comment (string)
  10. Magic (int)
  11. Stoploss Pips (int)     (Zero):Means No Stoploss value calculation
  12. Takeprofit Pips (int)  (Zero):Means No Takeprofit value calculation

 Sample Input File :

Ref no (String);symbol (string);cmd (int);volume (double);price (double);slippage (int);stoploss (double);takeprofit (double);comment (string);magic (int);slPips (int);tpPips (int)

ref101;EURUSD;BUY;0.01;0;5;0;0;my eur comment;35600;300;500

ref102;EURUSD;SELL;0.02;0;5;0;0;my eur comment;35601;100;200

ref103;EURUSD;BUY_LIMIT;0.01;1.08;5;1.07;1.11;my eur comment;35602;400;400

ref104;EURUSD;SELL_LIMIT;0.02;1.12;5;1.14;1.09;my eur comment;35603;500;500

ref114;EURUSD;SELL_LIMIT;0.02;1.12;5;1.14;1.09;my eur comment;35603;500;500

ref105;EURUSD;BUY_STOP;0.01;1.13;5;1.11;1.14;my eur comment;35604;600;600

ref106;EURUSD;SELL_STOP;0.02;1.09;5;1.11;1.07;my eur comment;35605;700;700

ref107;CADJPY;BUY;0.02;0;5;0;0;this ruble ;35605;1000;2000

ref108;CADJPY;BUY;0.02;0;5;0;0;this ruble ;35605;0;0


2. Run

Excel to Orders

script on any currently opened chart window in your terminal.

After initiating the script , result .csv file is created in the same sub-directory of MT4

...MQL4\Files\Excel_to_Orders_Results.csv

Result csv structure:

  1. Ref no (string)
  2. Symbol (string)
  3. Cmd (string)
  4. Volume (double)
  5. Price (double)
  6. Slippage (int)
  7. Stoploss (double)
  8. Takeprofit (double)
  9. Comment (string)
  10. Magic (int)
  11. Stoploss Pips (int)
  12. Takeprofit Pips (int)
  13. Ticket (int)
  14. Error Code (int)
  15. Error Description (string)

Last 3 columns are appended at the end of your input record.


 Sample Output File :

Ref no (String);symbol (string);cmd (int);volume (double);price (double);slippage (int);stoploss (double);takeprofit (double);comment (string);magic (int);slPips (int);tpPips (int);Ticket (int);Error code (int);Error description (string)

ref101;EURUSD;BUY;0.01;0;5;0;0;my eur comment;35600;300;500;127970091;0;no error

ref102;EURUSD;SELL;0.02;0;5;0;0;my eur comment;35601;100;200;127970093;0;no error

ref103;EURUSD;BUY_LIMIT;0.01;1.08;5;1.07;1.11;my eur comment;35602;400;400;127970095;0;no error

ref104;EURUSD;SELL_LIMIT;0.02;1.12;5;1.14;1.09;my eur comment;35603;500;500;-1;130;invalid stops

ref114;EURUSD;SELL_LIMIT;0.02;1.12;5;1.14;1.09;my eur comment;35603;500;500;-1;130;invalid stops

ref105;EURUSD;BUY_STOP;0.01;1.13;5;1.11;1.14;my eur comment;35604;600;600;-1;130;invalid stops

ref106;EURUSD;SELL_STOP;0.02;1.09;5;1.11;1.07;my eur comment;35605;700;700;127970096;0;no error

ref107;CADJPY;BUY;0.02;0;5;0;0;this ruble ;35605;1000;2000;127970099;0;no error

ref108;CADJPY;BUY;0.02;0;5;0;0;this ruble ;35605;0;0;127970100;0;no error




3. You may open your result file

...MQL4\Files\Excel_to_Orders_Results.csv

with excel to view the return codes of your order records.

Please report any bug issue or free development request (volkanyurci@gmail.com) upon your needs.

评论 4
fishwife
14
fishwife 2019.08.07 15:00 
 

Works great - just what I was looking for to quickly transfer my orders from excel to MT4. Thanks for providing this

推荐产品
该产品的买家也购买
筛选:
lmd
84
lmd 2020.09.25 16:47 
 

用户没有留下任何评级信息

Ahmd‎ Abwmstfy
155
Ahmd‎ Abwmstfy 2020.07.16 16:30   

Very cool script, easy to use, and very fast I recommend using it as well as customizing script in HotKey inside MT4 to execute orders faster than Excel to MetaTrader platform. Really creative programmer, thank you.

fishwife
14
fishwife 2019.08.07 15:00 
 

Works great - just what I was looking for to quickly transfer my orders from excel to MT4. Thanks for providing this

Matthew Todorovski
13154
Matthew Todorovski 2018.06.16 11:19 
 

用户没有留下任何评级信息

版本 200.718 2020.07.17
Make available in Live accounts.
版本 200.716 2020.07.16
1. Order Type selection field (CMD) in Input file is changed from Integer to string such as "BUY","SELL","BUY_STOP",...
2. New <Stoploss Pips> field is added. Stoploss value can be calculated with this field unless it is not ZERO.
3. New <Takeprofit Pips> field is added. Takeprofit value can be calculated with this field unless it is not ZERO.