Download Automaticaly file

MQL5 エキスパート

仕事が完了した

実行時間1 日
依頼者からのフィードバック
Alain Is very professional data scientist, I full recommend, this is the man!
開発者からのフィードバック
Interesting job and very nice customer. Recommended.

指定

Hi,


   I have an EA that is feed with a file wich need to be extracted from internet every day from a web site. To do this mannualy I need to click on a button in this site and the file is downloaded (picture bellow), but I would like to do this automatically, Using WebRequest() The file must be downloaded on actual date of the form to "File" folder and then unziped there overwirting the older file.

http://www.b3.com.br/pt_br/market-data-e-indices/servicos-de-dados/market-data/consultas/mercado-a-vista/opcoes/posicoes-em-aberto/


You can use the code bellow as example, it works but the date of the form is fixed, you need put always the actual date

Use Chrome to inspect, the execution and debug what happens



oid OnStart() 
  { 
   string cookie=NULL,headers; 
   char   post[],result[]; 
   string url="http://www.b3.com.br/lumis/portal/file/fileDownload.jsp?fileId=8AE490C96A051101016A0596E52F6182"; 
//--- para trabalhar com o servidor é necessário adicionar a URL "https://finance.yahoo.com" 
//--- na lista de URLs permitidas (menu Principal->Ferramentas->Opções, guia "Experts"): 
//--- redefinimos o código do último erro 
   ResetLastError(); 
//--- download da página html do Yahoo Finance 
   int res=WebRequest("GET",url,cookie,NULL,500,post,0,result,headers); 
   if(res==-1) 
     { 
      Print("Erro no WebRequest. Código de erro =",GetLastError()); 
      //--- é possível que a URL não esteja na lista, exibimos uma mensagem sobre a necessidade de adicioná-la 
      MessageBox("É necessário adicionar um endereço '"+url+"' à lista de URL permitidas na guia 'Experts'","Erro",MB_ICONINFORMATION); 
     } 
   else 
     { 
      if(res==200) 
        { 
         //--- download bem-sucedido 
         PrintFormat("O arquivo foi baixado com sucesso, tamanho %d bytes.",ArraySize(result)); 
         //PrintFormat("Cabeçalhos do servidor: %s",headers); 
         //--- salvamos os dados em um arquivo 
         int filehandle=FileOpen("url.zip",FILE_WRITE|FILE_BIN); 
         if(filehandle!=INVALID_HANDLE) 
           { 
            //--- armazenamos o conteúdo do array result[] no arquivo 
            FileWriteArray(filehandle,result,0,ArraySize(result)); 
            //--- fechamos o arquivo 
            FileClose(filehandle); 
           } 
         else 
            Print("Erro em FileOpen. Código de erro =",GetLastError()); 
        } 
      else 
         PrintFormat("Erro de download '%s', código %d",url,res); 
     } 
  }


応答済み

1
開発者 1
評価
(277)
プロジェクト
334
55%
仲裁
14
36% / 29%
期限切れ
1
0%
2
開発者 2
評価
(94)
プロジェクト
148
59%
仲裁
16
38% / 13%
期限切れ
25
17%
パブリッシュした人: 1 code
3
開発者 3
評価
(144)
プロジェクト
285
42%
仲裁
19
63% / 5%
期限切れ
29
10%
パブリッシュした人: 2 codes
4
開発者 4
評価
(23)
プロジェクト
25
12%
仲裁
1
0% / 100%
期限切れ
8
32%
5
開発者 5
評価
(215)
プロジェクト
302
79%
仲裁
4
25% / 0%
期限切れ
62
21%
パブリッシュした人: 7 codes
類似した注文
1.RSI strategy for gold , use RSI to identify overbought (above 70)and oversold (below 30) conditions. .Implement entry signals when RSI crosses these thresholds. 2.Risk management , set a maximum percentage of account equity per trade 1-2 % . Implement stop loss and take profit levels to limit loses and lock in gains. .Apply a maximum draw down limit to prevent significant losses. 3. Trade execution , ensure proper
Tick collector 50+ USD
Need an EA for trading Future Contracts of US indexes. A simple strategy with two versions. 1- Version 1 A simple Buy/sell order . I buy with 2 sell orders or I sell with 2 buys order . Predetermined profit . Repeat and rinse. Insertion of 2nd order at predetermined loss ticks ,profit in average ,SL placed . 2- Version A simple Buy or Sell order with predetermined loss .One buy and two sell or I sell and two buys in
Hedge Grid EA 50+ USD
I dont know anything about trading. I am looking for a mql5 code, which can place buy and sell at same time (Hedged grid EA). If any one have any such code developed already, please share me more details on it. I'm willing to purchase. Thank you
I need a MetaTrader 5 Expert Advisor that will: 1. Detect when any position from a group of trades (same symbol, same entry price) closes in profit (TP1 hit). 2. When the first profitable close of a group occurs, automatically move the SL of all remaining open positions in that group to their entry price (breakeven). 3. The groups will be opened by a separate EA (such as a signal copier), so no trade opening logic
hello great developer Hi! I have a fairly simple tradingview script I need ported over to cTrader for a trading bot I am looking for a developer to build a simple ORB (Opening Range Breakout) trading strategy . Requirements: ORB calculation and breakout entries (long & short) Static stop loss based on the signal candle Fixed risk–reward take profit Risk calculator to automatically size positions correctly Follow-up
I need a custom MT5 Expert Advisor. Timeframe: M15 Strategy Logic: 1. Detect Change of Character (CHoCH) / Break of Structure (rule-based approximation). 2. Identify inducement (liquidity grab) before BOS. 3. Mark POI zone based on last impulsive move. 4. Apply Fibonacci on the impulse leg. 5. Only trade if price enters Fibonacci Golden Zone (0.618 – 0.786) inside POI. 6. Wait for Pin Bar inside the zone. - Long
Должность: Пользовательский советник MT5 для стратегии пробоя максимумов/минимумов на свечных графиках. Описание/требования к должности: Здравствуйте! Мне нужен пользовательский советник (Expert Advisor, EA) для MetaTrader 5 , основанный на простой стратегии пробоя свечей. Советник должен строго соответствовать следующим правилам: 1. Условия покупки: Откройте ордер на покупку , когда текущая цена закроется выше
Hello! I'm looking for an EA to help me pass a prop firm challenge. I know very little about this, so I have practically no demands. Any EA that sort of works is fine. Let me know what you've got. Thanks in advance
//+------------------------------------------------------------------+ //| XAUUSD Ultimate Institutional EA | //| Features: | //| - True swing-based market structure | //| - BOS sniper entries on M5 | //| - Liquidity sweep filter | //| - Partial TP + breakeven | //| - Visual BOS, swings, liquidity
MetalFlow EA 70+ USD
I need a MetaTrader 5 Expert Advisor built to trade metals only: XAUUSD, XAGUSD, XPDUSD, and XPTUSD. The EA should be trend-based using moving averages and RSI, enter on pullbacks, allow only one trade per symbol, and use strict risk management with volatility-based stop loss and 2:1 reward-to-risk. It should trade only during active market hours, include spread filtering, auto lot sizing, and be lightweight and

プロジェクト情報

予算
30 - 40 USD