Por que o indicador de notícias não está funcionando no Windows 7?

 
А?
 
Para cima
 

90% - tire o terminal do arquivo do programa...

 
xrust:

90% - tire o terminal do arquivo do programa...

Eu tenho o terminal em meu drive D. Não existe tal pasta...
 

depois procure no firewall (mas primeiro, procure onde os arquivos são salvos)

 
Qual firewall? Não é essa a questão. É o cristal Kaspersky.
 
vlandex:


Enviar o indicador aqui
 
Mischek:

Enviar o indicador aqui
//+------------------------------------------------------------------+
//| News.mq4 |
//| * |
//| * |
//+------------------------------------------------------------------+
#propriedade copyright "Bulagin Andrey"
#link do proprietário "andre9@ya.ru
#janela_do_cartão_indicador de propriedade
#property indicator_buffers 0

//----
#importar "wininet.dll"
int InternetAttemptConnect (int x);
int InternetOpenA(string sAgent, int lAccessType,
string sProxyName = "", string sProxyBypass = "",
int lFlags = 0);
int InternetOpenUrlA(int hInternetSession, string sUrl,
sHeadersSHeaders = "", int lHeadersLength = 0,
int lFlags = 0, int lContext = 0);
int InternetReadFile(int hFile, int& sBuffer[], int lNumBytesToRead,
int& lNumberOfBytesReading[]);
int InternetCloseHandle(int hInet);
#importante.
bool externo hoje = falso; // mostrar apenas notícias para hoje (dd$)
linhas externas = verdadeiro; // mostrar linhas verticais no gráfico em momentos de divulgação de notícias
textos de bool externo = verdadeiro; // mostrar etiquetas de texto com descrições de notícias
comentários externos = verdadeiro; // exibir uma lista das notícias futuras e passadas mais próximas
int int total_in_list = 22; // número de notícias na lista

bool externo alto = verdadeiro; // exibir notícias importantes
bool mídia externa = verdadeiro; // exibir notícias de importância média
bool externo baixo = verdadeiro; // mostrar notícias de baixa importância

atualização int externa = 15; // atualizar a lista de notícias a cada 15 minutos

bool auto = true; // notícias auto-selecionadas adequadas para o par de moedas do gráfico
bool eur externo = verdadeiro; // exibir notícias para moedas específicas
usd = verdadeiro;
bool jpy externo = verdadeiro;
bool gbp externo = verdadeiro;
bool chf externo = verdadeiro;
bool cad externo = verdadeiro;
aud aud externo = verdadeiro;
bool nzd externo = verdadeiro;

cor exterior high_color = Maroon; // cor de notícias importantes
cor exterior média_cor = Siena; // cor para notícias gerais
cor exterior baixa_cor = DarkSlateGray; // cor para notícias menores

bool russian externo = falso; // utilizar um arquivo de tradução para a russificação de notícias

fuso horário externo int server_timezone = 2; // fuso horário do servidor (Alpary - GMT+2)
fuso horário int externo = 4; // mostrar fuso horário (Moscou - GMT+4)

alertas de bool externo = falsos; // Alertar o servidor através de sinais sonoros.
alerta int externo_antes = 5; // alerta 5 minutos antes da divulgação da notícia.
alerta int externo_tudo = 30; // bip a cada 30 segundos

// -----------------------------------------------------------------------------------------------------------------------------
int TotalNews = 0;
Notícias de corda[1000][10];
data/hora LastUpdate = 0;
int NextNewsLine = 0;
int LastAlert = 0;
Traduzir[1000][2];
int TotalTranslate = 0;

// -----------------------------------------------------------------------------------------------------------------------------
int init()
{
if(auto) // auto-selecionar notícias adequadas para o par de moedas atual
{
string sym = Símbolo();
if(StringFind(sym, "EUR") != -1) eur = true; else eur = false;
if(StringFind(sym, "USD") != -1) usd = true; else usd = false;
if(StringFind(sym, "JPY") != -1) jpy = true; else jpy = false;
if(StringFind(sym, "GBP") != -1) gbp = true; else gbp = false;
if(StringFind(sym, "CHF") != -1) chf = true; else chf = false;
if(StringFind(sym, "CAD") != -1) cad = true; else cad = false;
if(StringFind(sym, "AUD") != -1) aud = true; else aud = false;
if(StringFind(sym, "NZD") != -1) nzd = true; else nzd = false;
}

if(russian) //preparando padrões de tradução de notícias
{
int fhandle = FileOpen("translate.txt", FILE_READ);
if(fhandle>0)
{
int i = 0;
while(!FileIsEnding(fhandle))
{
string str = FileReadString(fhandle);
if(str == "") quebra;
Traduzir[i][0] = str;
Traduzir[i][1] = FileReadString(fhandle);
if(Translate[i][1] == "") Traduzir[i][1] = Traduzir[i][0];
i++;
}
TotalTranslate = i;
FileClose(fhandle);
}
}

retorno(0);
}

// -----------------------------------------------------------------------------------------------------------------------------
int deinit()
{
for(int i=0; i<TotalNews; i++)
{
ObjectDelete("Linha de notícias "+i");
ObjectDelete("News Text "+i);
}

retorno(0);
}

// -----------------------------------------------------------------------------------------------------------------------------
int start()
{
Filtro de corda1 = "";
if(!eur) Filter1 = Filter1 + "EUR|";
if(!usd) Filter1 = Filter1 + "USD|";
if(!jpy) Filter1 = Filter1 + "JPY|";
if(!gbp) Filter1 = Filter1 + "GBP|";
if(!chf) Filter1 = Filter1 + "CHF|";
if(!cad) Filter1 = Filter1 + "CAD|";
if(!aud) Filter1 = Filter1 + "AUD|";
if(!nzd) Filter1 = Filter1 + "NZD|";

Filtro de corda2 = "";
if(!high) Filter2 = Filter2 + "high|";
if(!medium) Filter2 = Filter2 + "Medium|";
if(!low) Filter2 = Filter2 + "Low|";

data/hora = TimeCurrent();
if(time >= LastUpdate+update*60) // atualizando a lista de notícias
{
for(int i=0; i<TotalNews; i++)
{
ObjectDelete("Linha de notícias "+i");
ObjectDelete("News Text "+i);
}

LastUpdate = hora;
if(today===verdadeiro)
{
string str = ReadWebPage("http://www.dailyfx.com/calendar/Dailyfx_Global_Economic_Calendar.csv?direction=none&collector=allInFolderDateDesc&view=today&timezone=GMT&currencyFilter="+Filter1+"&importanceFilter="+Filter2+"&time="+time);
}
else str = ReadWebPage("http://www.dailyfx.com/calendar/Dailyfx_Global_Economic_Calendar.csv?direction=none&collector=allInFolderDateDesc&view=week&timezone=GMT&currencyFilter="+Filter1+"&importanceFilter="+Filter2+"&time="+time);

if(str == "") return(0);
int pos = StringFind(str, "str, "rr, "rn, "rn")
str = StringTrimRight(StringTrimLeft(StringSubstr(str,pos+6)));


arr[1000];
TotalNews = Explodir(str, "str, "rn, rn", arr);
for( i=0; i<TotalNews; i++)
{
arr1[10];
Explodir(arr[i], ",", arr1);
for( int j=0; j<10; j++ )
Notícias[i][j] = arr1[j];
tmp[3], tmp1[2];
Explode(News[i][0], " ", tmp);
int mon = 0;
if(tmp[1]=="Jan") mon=1; caso contrário
if(tmp[1]=="Feb") mon=2; else
if(tmp[1]=="Mar") mon=3; caso contrário
if(tmp[1]=="Apr") mon=4; else
if(tmp[1]=="May") mon=5; else
if(tmp[1]=="Jun") mon=6; caso contrário
if(tmp[1]=="Jul") mon=7; caso contrário
if(tmp[1]=="Aug") mon=8; else
if(tmp[1]=="Set") mon=9; else
if(tmp[1]=="Oct") mon=10; caso contrário
if(tmp[1]=="Nov") mon=11; else
if(tmp[1]=="Dez") mon=12;
Notícias[i][0] = Ano()+". "+mon+". "+tmp[2];

Explode(News[i][1], " ", tmp);
bool pm = tmp[1]=="PM";
Explodir(tmp[0], ":", tmp1);
tmp1[0] = StrToInteger(tmp1[0])%12;
if(pm) tmp1[0] = StrToInteger(tmp1[0])+12;
News[i][1] = tmp1[0]+": "+tmp1[1];

datetime dt = StrToTime(News[i][0]+""+News[i][1]);
News[i][0] = TimeToStr(dt + server_timezone*60*60, TIME_DATE);
News[i][1] = TimeToStr(dt + server_timezone*60*60, TIME_MINUTES);
News[i][9] = TimeToStr(dt + show_timezone*60*60, TIME_MINUTES);

se(rústico)
{
for(j=0; j<TotalTranslate; j++)
{
pos = StringFind(News[i][4], Translate[j][0]);
if(pos != -1) News[i][4] = StringSubstr(News[i][4], 0, pos) + Translate[j][1] + StringSubstr(News[i][4], pos+StringLen(Translate[j][0]);
}
}

}

data/hora atual = 0;
for( i=0; i<TotalNews; i++) // criar linhas e títulos de notícias no gráfico
{
if(StrToTime(News[i][0]+""+News[i][1]) == corrente) continua;
atual = StrToTime(News[i][0]+""+News[i][1]);
cor clr;
if(News[i][5] == "Low") clr = low_color; else
if(News[i][5] == "Medium") clr = medium_color; else
if(News[i][5] == "High") clr = high_color;

texto de corda = "";
if(News[i][8] != """ || Notícias[i][7] != "") texto = "[" + Notícias[i][8] + ", " + Notícias[i][7] + "]";
if(News[i][6] != "") text = text + " + News[i][6];

if(linhas)
{
ObjectCreate("Linha de notícias "+i, OBJ_VLINE, 0, atual, 0);
ObjectSet("Linha de notícias "+i, OBJPROP_COLOR, clr);
ObjectSet("Linha de notícias "+i, OBJPROP_STYLE, STYLE_DASHDOTDOT);
ObjectSet("Linha de notícias "+i, OBJPROP_BACK, verdadeiro);
ObjectSetText("Linha de notícias "+i, Notícias[i][9] + " " + Notícias[i][4] + " + texto, 8);
}

se (textos)
{
ObjectCreate("News Text "+i, OBJ_TEXT, 0, atual, WindowPriceMin()+(WindowPriceMax()-WindowPriceMin())*0.8 );
ObjectSet("News Text "+i, OBJPROP_COLOR, clr;)
ObjectSet("News Text "+i, OBJPROP_ANGLE, 90);
ObjectSetText("Texto de notícias "+i, Notícias[i][9] + " " + Notícias[i][4] + " + texto, 8);
}


}

for(i=0; i<TotalNews; i++)
if(StrToTime(News[i][0]+""+News[i][1]) > tempo) break;
NextNewsLine = i;
LastAlert = 0;

if(comentários) //criação de lista de notícias no gráfico
{
int start = 0;
if(NextNewsLine >= 5) start = NextNewsLine - 5;
string com = "_____ LastNewsLine ______________________\n";
for(i=start; i<start+total_in_list && i<TotalNews; i++)
{
texto = "";
if(News[i][8] != """ || Notícias[i][7] != "") texto = "[" + Notícias[i][8] + ", " + Notícias[i][7] + "]";
if(News[i][6] != "") text = text + " " " + News[i][6];
com = com + Notícias[i][9] + " + StringSubstr(Notícias[i][5], 0, 1) + " + Notícias[i][4] + " + texto + "\n";
if(i===NextNewsLine-1) com = com + "_____ Notícias Futuras ________________________\n";
}
Comentário(com);
}
} // fim da atualização da lista de notícias

datatime next_time = StrToTime(News[NextNewsLine][0]+""+News[NextNewsLine][1]);
if(time >= next_time) // próxima notícia está fora
{
LastUpdate = hora - atualização*60 + 60; // atualizar a lista de notícias um minuto após o próximo comunicado à imprensa
for(i=0; i<TotalNews; i++)
if(StrToTime(News[i][0]+""+News[i][1]) > tempo) break;
NextNewsLine = i;

LastAlert = 0;
se(comentários)
{
início = 0;
if(NextNewsLine >= 5) start = NextNewsLine - 5;
com = "";
for(i=start; i<start+10 && i<TotalNews; i++)
{
texto = "";
if(News[i][8] != """ || Notícias[i][7] != "") texto = "[" + Notícias[i][8] + ", " + Notícias[i][7] + "]";
if(News[i][6] != "") text = text + " " " + News[i][6];
com = com + Notícias[i][9] + " + StringSubstr(Notícias[i][5], 0, 1) + " " + Notícias[i][4] + " + texto + "\n";
}
Comentário(com);
}
}

next_time = StrToTime(News[NextNewsLine][0]+""+News[NextNewsLine][1]);
if(time >= next_time - alert_before*60) // próxima notícia está prestes a ser publicada
{
if(time >= LastAlert + alert_every)
{
if(alertas) PlaySound("alert.wav");
Imprimir("Próximas notícias serão lançadas em " + (((next_time)-(next_time)%60)/60) + " " + ((next_time)%60) + " segundos(s)");
LastAlert = tempo;
}
}


retorno(0);
}

// -----------------------------------------------------------------------------------------------------------------------------
int Explode(string strode, string delimiter, string& arr[])
{
int i = 0;
int pos = StringFind(str, delimitador);
while(pos != -1)
{
if(pos == 0) arr[i] = ""; ou arr[i] = StringSubstr(str, 0, pos);
i++;
str = StringSubstr(str, pos+StringLen(delimitador));
pos = StringFind(str, delimitador);
if(pos == -1 || str == "") quebra;
}
arr[i] = str;

retorno(i+1);
}

// -----------------------------------------------------------------------------------------------------------------------------
ReadWebPage(string url)
{
if(!IsDllsAllowed())
{
Alerta("Devemos permitir DLLs em configurações;)
retorno(");
}
int rv = InternetAttemptConnect(0);
if(rv != 0)
{
Alerta("Erro ao ligar para InternetAttemptConnect()");
retorno(");
}
na hInternetSession = InternetOpenA("Microsoft Internet Explorer",
0, "", "", 0);
if(hInternetSession <= 0)
{
Alerta("Erro ao chamar InternetOpenA()");
retorno(");
}
int hURL = InternetOpenUrlA(hInternetSession,
url, "", 0, 0, 0, 0);
if(hURL <= 0)
{
Alerta("Erro ao chamar InternetOpenUrlA();
InternetCloseHandle(hInternetSession);
retorno(0);
}
int cBuffer[256];
int dwBytesLer[1];
fio TXT = "";
while(!IsStopped())
{
for(int i = 0; i<256; i++) cBuffer[i] = 0;
O resultado = InternetReadFile(hURL, cBuffer, 1024, dwBytesRead);
if(dwBytesRead[0] == 0) quebra;
texto de corda = "";
for(i = 0; i < 256; i++)
{
texto = texto + CharToStr(cBuffer[i] & 0x000000FF);
if(StringLen(text) == dwBytesRead[0]) quebra;
texto = texto + CharToStr(cBuffer[i] >> 8 & 0x000000FF);
if(StringLen(text) == dwBytesRead[0]) quebra;
texto = texto + CharToStr(cBuffer[i] >> 16 & 0x000000FF);
if(StringLen(text) == dwBytesRead[0]) quebra;
texto = texto + CharToStr(cBuffer[i] >> 24 & 0x000000FF);
}
TXT = TXT + texto;
Dormir(1);
}
if(TXT == "") Alerta("Nenhum dado lido");
InternetCloseHandle(hInternetSession);

retorno(TXT);
}

// -----------------------------------------------------------------------------------------------------------------------------
 
vlandex:
Tente
Arquivos anexados:
news.mq4  18 kb
 

Estou apagando o resto do fio. Quanto spam você pode fazer?

 

E se mais spam aparecer, terei a opção de bani-lo. Isto é apenas um aviso.