Export Market Watch Symbol Data to CSV?

 
Hey I was researching something and realized that I  would want to export all the settings in the market watch window to a CSV file for a given server platform.

When you go to Market Watch window and Right Click on an instrument, and press specifications it brings up a small window with information from your broker.

I haven't found anything looking around, but is there a way to export this to a CSV?

I wanted to compare and update it rather than manually have to go through every instrument.

If there isn't I would be willing to work together with some people on google drive to assemble something we could all work on together let me know! =)
 

Hi I have just written this script (not tested yet):

//+------------------------------------------------------------------+
//|                                                     test_Pip.mq4 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
#property strict
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+

   int dgt;
   double Prc, pnt, lsz, nSz, JFD, TiV, Atr, TSz;
   string SYM, Line;
   bool   sel;

void OnStart()  {
   int hdl  = FileOpen("PipFind.csv",FILE_READ|FILE_WRITE|FILE_TXT|FILE_COMMON),
       nSymAll = SymbolsTotal(false),
       cnt;
   Line = "Broker\tSym\tBase\tProfit\tMargin\tDescr.\tPath\tPrc\tLotSize\tTickValue\tTickSize\tDigits\tPnt\tATR\n";
   FileSeek(hdl,0,SEEK_END);
   FileWriteString(hdl, Line, StringLen(Line) );
   
   while( --nSymAll>=0 && !IsStopped() ) { 
      ResetLastError(); 
      SYM = SymbolName(nSymAll,false);
      Comment("# ",nSymAll," ",SYM,"  ..");
      Prc = iClose(SYM,PERIOD_D1,18);
      Atr = iATR(SYM,PERIOD_D1,10,0);
      TiV = MarketInfo(SYM,MODE_TICKVALUE);
      cnt = 0;
      while ( (_LastError == 4066 || Prc*Atr*TiV < 0.0000000000000001) && !IsStopped() && cnt++ < 3 ) {
         Comment("# ",nSymAll," ",SYM,"  Prc: ",DoubleToString(Prc,5),"  Atr: ",DoubleToString(Atr,5),
         "  TiV: ",DoubleToString(TiV,5),"   waiting for quotes .. ",cnt);
         Sleep(1000); 
         ResetLastError();
         Prc = iClose(SYM,PERIOD_D1,18);
         Atr = iATR(SYM,PERIOD_D1,10,0);
         TiV = MarketInfo(SYM,MODE_TICKVALUE);
      }
      //if (Prc*Atr < 0.0000000000000001) && cnt>20) continue;
      Comment("# ",nSymAll," ",SYM,"  Prc: ",DoubleToString(Prc,5),"  Atr: ",DoubleToString(Atr,5),
      "  TiV: ",DoubleToString(TiV,5),"   ok: ",cnt);
      TSz = MarketInfo(SYM,MODE_TICKSIZE);

      dgt = (int)MarketInfo(SYM,MODE_DIGITS);
      pnt = MarketInfo(SYM,MODE_POINT);
      lsz = MarketInfo(SYM,MODE_LOTSIZE);
      string strA,strB,strC,strD,strE;
      SymbolInfoString(SYM,SYMBOL_CURRENCY_BASE,strA);
      SymbolInfoString(SYM,SYMBOL_CURRENCY_PROFIT,strB);
      SymbolInfoString(SYM,SYMBOL_CURRENCY_MARGIN,strC);
      SymbolInfoString(SYM,SYMBOL_DESCRIPTION,strD);
      SymbolInfoString(SYM,SYMBOL_PATH,strE);
      //Line = "Broker\tSym\tBase\tProfit\tMargin\tDescr.\tPath\tPrc\tLotSize\tTickValue\tTickSize\tDigits\tPnt\tATR\n";
      Line = StringFormat(
         "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%0.7f\t%s\t%s\t%s\t%s\n",
         AccountInfoString(ACCOUNT_COMPANY),SYM,
         strA,strB,strC,strD,strE, Prc,
         DoubleToString(lsz),DoubleToString(TiV),DoubleToString(TSz),
         dgt,DoubleToString(pnt),DoubleToString(Atr)
      );
      FileWriteString(hdl, Line, StringLen(Line) );
      Comment("# ",nSymAll," ",SYM,"  DONE");
   }
   FileClose(hdl);
}
//+------------------------------------------------------------------+

I know csv-file could be written differently - but this has become my habit.

 
Carl Schreiber:

Hi I have just written this script (not tested yet):

I know csv-file could be written differently - but this has become my habit.

Compile the script and run it?  There does not seem to be any output in the data folder.

Where do you put PipFind.csv ??  You have to make that correct?
 
Bradford Hall:
Compile the script and run it?  There does not seem to be any output in the data folder.

Where do you put PipFind.csv ??  You have to make that correct?
would it work for .xslx?
 
Bradford Hall:
would it work for .xslx?
I ran the script but it wouldn't run again, couldn't find any files... :-\

I wonder if this data is even possible to export or how you would get the script/program to read it?
 

The csv file is in the \Common\Files folder.

Put your cursor above FileOpen( and press F1. There you can read everything you need!

First compile it then e.g. just press F5 and run the file in debug-mode.

 
Carl Schreiber:

The csv file is in the \Common\Files folder.

Put your cursor above FileOpen( and press F1. There you can read everything you need!

First compile it then e.g. just press F5 and run the file in debug-mode.

there's a csv file but it's all a bunch of gibberish...?   How do you get the the contract specifications?
 
Bradford Hall:
there's a csv file but it's all a bunch of gibberish...?   How do you get the the contract specifications?
It's all in the first column, not-delineated*


Broker Sym Base Profit Margin Descr. Path Prc LotSize TickValue TickSize Digits Pnt ATR
TW Corp. XAUUSDi XAU USD XAU Gold vs US Dollar Metals ecn\XAUUSDi 1291.3700000 100.00000000 0.00000000 0.01000000 (non-string passed)
TW Corp. XAGUSDi XAG USD XAG silver vs US dollar Metals ecn\XAGUSDi 17.5240000 5000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. USDTRYi USD TRY USD US Dollar vs Turkish Lira ECN\USDTRYi 2.8030100 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. USDSGDi USD SGD USD US Dollar vs Singapore Dollar ECN\USDSGDi 1.3401800 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. USDSEKi USD SEK USD US Dollar vs Swedish Krona ECN\USDSEKi 7.9572000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. USDNOKi USD NOK USD US Dollar vs Norwegian Krone ECN\USDNOKi 8.0131000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. USDMXNi USD MXN USD US Dollar vs Mexican Peso ECN\USDMXNi 17.2008000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. USDJPYi USD JPY USD US Dollar vs Japanese Yen ECN\USDJPYi 106.4020000 100000.00000000 0.91305023 0.00100000 (non-string passed)
TW Corp. USDDKKi USD DKK USD US Dollar vs Danish Krone ECN\USDDKKi 6.4508000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. USDCHFi USD CHF USD US Dollar vs Swiss Franc ECN\USDCHFi 0.9539600 100000.00000000 1.01034594 0.00001000 (non-string passed)
TW Corp. USDCADi USD CAD USD US Dollar  vs Canadian Dollar ECN\USDCADi 1.2528100 100000.00000000 0.76772485 0.00001000 (non-string passed)
TW Corp. NZDUSDi NZD USD NZD New Zealand Dollar vs US Dollar ECN\NZDUSDi 0.7017700 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. NZDJPYi NZD JPY NZD New Zealand Dollar vs Japanese Yen ECN\NZDJPYi 74.6490000 100000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. NZDCHFi NZD CHF NZD New Zealand Dollar vs Swiss Franc ECN\NZDCHFi 0.6693300 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. NZDCADi NZD CAD NZD New Zealand Dollar vs Canadian Dollar ECN\NZDCADi 0.8792100 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. GBPUSDi GBP USD GBP Great Britain Pound Sterling vs US Dollar ECN\GBPUSDi 1.4671300 100000.00000000 1.00000000 0.00001000 (non-string passed)
TW Corp. GBPSGDi GBP SGD GBP Great Britain Pound sterling vs Singapore Dollar ECN\GBPSGDi 1.9665000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. GBPNZDi GBP NZD GBP Great Britain pound sterling  vs New Zealand dollar ECN\GBPNZDi 2.0891900 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. GBPNOKi GBP NOK GBP Great Britain Pound Sterling  vs Norwegian Krone ECN\GBPNOKi 11.7537000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. GBPJPYi GBP JPY GBP Great Britain Pound Sterling  vs Japanese Yen ECN\GBPJPYi 156.1050000 100000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. GBPCHFi GBP CHF GBP Great Britain Pound Sterling vs Swiss Franc ECN\GBPCHFi 1.3998100 100000.00000000 1.01035615 0.00001000 (non-string passed)
TW Corp. GBPCADi GBP CAD GBP Great Britain Pound Sterling vs Canadian Dollar ECN\GBPCADi 1.8381400 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. GBPAUDi GBP AUD GBP Great Britain Pound Sterling  vs Australian Dollar ECN\GBPAUDi 1.9134300 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. EURUSDi EUR USD EUR Euro vs US Dollar ECN\EURUSDi 1.1532200 100000.00000000 1.00000000 0.00001000 (non-string passed)
TW Corp. EURTRYi EUR TRY EUR Euro vs Turkish Lira ECN\EURTRYi 3.2332000 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. EURSEKi EUR SEK EUR Euro vs Swedish Krona ECN\EURSEKi 9.1770000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. EURNZDi EUR NZD EUR Euro vs New Zealand Dollar ECN\EURNZDi 1.6420300 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. EURNOKi EUR NOK EUR Euro vs Norwegian Krone ECN\EURNOKi 9.2402000 100000.00000000 0.00000000 0.00010000 (non-string passed)
TW Corp. EURJPYi EUR JPY EUR Euro vs Japanese Yen ECN\EURJPYi 122.7110000 100000.00000000 0.91297520 0.00100000 (non-string passed)
TW Corp. EURGBPi EUR GBP EUR Euro vs Great Britain Pound Sterling ECN\EURGBPi 0.7859600 100000.00000000 1.47063000 0.00001000 (non-string passed)
TW Corp. EURCHFi EUR CHF EUR Euro vs Swiss Franc ECN\EURCHFi 1.1002500 100000.00000000 1.01035615 0.00001000 (non-string passed)
TW Corp. EURCADi EUR CAD EUR Euro vs Canadian Dollar ECN\EURCADi 1.4446000 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. EURAUDi EUR AUD EUR Euro vs Australian Dollar ECN\EURAUDi 1.5037600 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. CHFJPYi CHF JPY CHF Swiss Franc vs Japanese Yen ECN\CHFJPYi 111.4690000 100000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. CADJPYi CAD JPY CAD Canadian Dollar vs Japanese Yen ECN\CADJPYi 84.9110000 100000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. CADCHFi CAD CHF CAD Canadian Dollar vs Swiss Franc ECN\CADCHFi 0.7613000 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. AUDUSDi AUD USD AUD Australian Dollar vs US Dollar ECN\AUDUSDi 0.7664700 100000.00000000 1.00000000 0.00001000 (non-string passed)
TW Corp. AUDNZDi AUD NZD AUD Australian Dollar vs New Zealand Dollar ECN\AUDNZDi 1.0918200 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. AUDJPYi AUD JPY AUD Australian Dollar vs Japanese Yen ECN\AUDJPYi 81.5310000 100000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. AUDCHFi AUD CHF AUD Australian Dollar vs Swiss Franc ECN\AUDCHFi 0.7311800 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. AUDCADi AUD CAD AUD Australian Dollar vs Canadian Dollar ECN\AUDCADi 0.9603000 100000.00000000 0.00000000 0.00001000 (non-string passed)
TW Corp. .WTICrude USD USD USD Crude Oil Energies\.WTICrude 45.1900000 1000.00000000 10.00000000 0.01000000 (non-string passed)
TW Corp. .USTECHCash USD USD USD E-Mini NASDAQ-100 IndicesUS\.USTECHCash 4379.8000000 10.00000000 1.00000000 0.10000000 (non-string passed)
TW Corp. .US500Cash USD USD USD E-mini S&P 500 IndicesUS\.US500Cash 2081.8000000 25.00000000 2.50000000 0.10000000 (non-string passed)
TW Corp. .US30Cash USD USD USD Mini-sized Dow (USD5) IndicesUS\.US30Cash 17892.0000000 1.00000000 1.00000000 1.00000000 (non-string passed)
TW Corp. .NGas USD USD USD Natural Gas Energies\.NGas 2.1160000 1000.00000000 0.00000000 0.00100000 (non-string passed)
TW Corp. .BrentCrude USD USD USD Brent Crude Oil Energies\.BrentCrude 45.9500000 1000.00000000 10.00000000 0.01000000 (non-string passed)
 

1) the delimiter is the tab: "\t" - if you want to change that replace "\t" b y e.g. ";"

2) I saw there are two items too less:

Line = StringFormat(
         "%s\t%s\t%s\t%s\t%s\t%s\t%s\t%0.7f\t%s\t%s\t%s\t%i\t%s\t%s\n",

replace this line with the one in the code - sorry.

I was thinking you load the csv-file in an office program there you would have seen the delimiter.

The first line contains the head of each column - open it in a officer program you should see that.

Reason: