Sie verpassen Handelsmöglichkeiten:
- Freie Handelsapplikationen
- Über 8.000 Signale zum Kopieren
- Wirtschaftsnachrichten für die Lage an den Finanzmärkte
Registrierung
Einloggen
Sie stimmen der Website-Richtlinie und den Nutzungsbedingungen zu.
Wenn Sie kein Benutzerkonto haben, registrieren Sie sich
//+------------------------------------------------------------------+ //| RedrawIndicators-2.mq4 | //| Satori | //| http://www.metaquotes.ru/forum/7790/ | //+------------------------------------------------------------------+ #property copyright "Satori" #property link "http://www.metaquotes.ru/forum/7790/" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Red #property indicator_color2 Blue #property indicator_color3 Yellow //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; extern int BarsCount=20; //кол-во считаемых баров, если 0 - то все extern string Currency1="EURUSD"; extern string Currency2="GBPUSD"; int handle,handle2; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexLabel(0,Currency1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexLabel(1,Currency2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); handle= FileOpen("TestFile.csv",FILE_CSV|FILE_WRITE,';'); handle2= FileOpen("TestFile2.csv",FILE_CSV|FILE_WRITE,';'); if(handle<1 || handle2<1 ) { Print("Файл не обнаружен, последняя ошибка ", GetLastError()); return(false); } else { FileWrite (handle,"index",Symbol(),"","index1",Currency1,"","index2",Currency2); FileWrite (handle2,"index",Symbol()," ",Currency1," ",Currency2); } return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- FileClose(handle); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int i; double test1,test2; datetime tt1,tt2,TimeMain; BarsCount=MathMin(Bars,(MathMin(iBars(Currency1,Period()),iBars(Currency2,Period())))); for (i=0;i<BarsCount-counted_bars;i++) { TimeMain=Time[i]; ExtMapBuffer1[i]=iTime(Currency1,Period(),iBarShift(Currency1,Period(),TimeMain)); ExtMapBuffer2[i]=iTime(Currency2,Period(),iBarShift(Currency2,Period(),TimeMain)); ExtMapBuffer3[i]=(ExtMapBuffer1[i]-ExtMapBuffer2[i]); tt1=Time[i]-ExtMapBuffer1[i]; tt2=Time[i]-ExtMapBuffer2[i]; if (ExtMapBuffer3[i]!=0 || tt1!=0 || tt2!=0) { if (FileWrite (handle, i,TimeToStr(Time[i]),"",iBarShift(Currency1,Period(),ExtMapBuffer1[i]),TimeToStr(ExtMapBuffer1[i]),"",iBarShift(Currency2,Period(),ExtMapBuffer2[i]),TimeToStr(ExtMapBuffer2[i]) )<=0) Print("нифига не пишет!!"); } FileFlush(handle); if ((iTime(Symbol(),Period(),i)!=iTime(Currency1,Period(),i) || Time[i]!=iTime(Currency1,Period(),i) || iTime(Currency1,Period(),i)!=iTime(Currency2,Period(),i) ) && i>0) { if (FileWrite (handle2,i, TimeToStr(Time[i])," ",TimeToStr(iTime(Currency1,Period(),i))," ",TimeToStr(iTime(Currency2,Period(),i)) )<=0) Print("нифига не пишет!!"); } }//---- return(0); } //+------------------------------------------------------------------+1) die Zeitreihen zwischengespeichert wurden (deshalb wird der Chart angezeigt)
2) die Adresse des Datenzentrums (bevor das Terminal über das Datenzentrum mit dem Alpari-Demokonto verbunden wurde)
. Also habe ich die Adresse des Datenzentrums entfernt und zum Alpari-Demokonto gewechselt, der Wechsel war erfolgreich, das Datenzentrum ist nicht mehr angeschlossen. Ich wechselte zurück zum MIG-Demokonto - die Verbindung zum Server war erfolgreich, aber die MarketWatch-Daten änderten sich nicht. Gezwungen, GBPJPY H4 (auf dem Chart) zu aktualisieren, die Geschichte prallte ab.
Aber die letzte Kurszeit ist immer noch 10-43 für alle Paare. Ich habe einen Build 199.
Jetzt werde ich versuchen, den Redraw2-Indikator auszuführen
Ich habe mir MarketWatch angeschaut - dort steht überall die gleiche Zeit 10:43.
Jetzt werde ich die dritte Variante machen, um alle Punkte zu punkten.
//+------------------------------------------------------------------+ //| RedrawIndicators-2.mq4 | //| Satori | //| http://www.metaquotes.ru/forum/7790/ | //+------------------------------------------------------------------+ #property copyright "Satori" #property link "http://www.metaquotes.ru/forum/7790/" #property indicator_separate_window #property indicator_buffers 3 #property indicator_color1 Red #property indicator_color2 Blue #property indicator_color3 Yellow //---- buffers double ExtMapBuffer1[]; double ExtMapBuffer2[]; double ExtMapBuffer3[]; extern int BarsCount=20; //кол-во считаемых баров, если 0 - то все extern string Currency1="EURUSD"; extern string Currency2="GBPUSD"; int handle,handle2; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { //---- indicators SetIndexStyle(0,DRAW_LINE); SetIndexBuffer(0,ExtMapBuffer1); SetIndexLabel(0,Currency1); SetIndexStyle(1,DRAW_LINE); SetIndexBuffer(1,ExtMapBuffer2); SetIndexLabel(1,Currency2); SetIndexStyle(2,DRAW_LINE); SetIndexBuffer(2,ExtMapBuffer3); handle= FileOpen("TestFile3.csv",FILE_CSV|FILE_WRITE,';'); handle2= FileOpen("TestFile3-2.csv",FILE_CSV|FILE_WRITE,';'); if(handle<1 || handle2<1 ) { Print("Файл не обнаружен, последняя ошибка ", GetLastError()); return(false); } else { FileWrite (handle,"index",Symbol(),"iBarShift1","index1","Time[index1-1]",Currency1,"Time[index1+1]","iBarShift2","index2","Time[index2-1]",Currency2,"Time[index2+1]"); FileWrite (handle2,"index",Symbol()," ",Currency1," ",Currency2); } return(0); } //+------------------------------------------------------------------+ //| Custom indicator deinitialization function | //+------------------------------------------------------------------+ int deinit() { //---- FileClose(handle); //---- return(0); } //+------------------------------------------------------------------+ //| Custom indicator iteration function | //+------------------------------------------------------------------+ int start() { int counted_bars=IndicatorCounted(); int i; double test1,test2; double Bar1,Bar2; int iBarShift1,iBarShift2; datetime tt1,tt2,TimeMain; BarsCount=MathMin(Bars,(MathMin(iBars(Currency1,Period()),iBars(Currency2,Period())))); for (i=0;i<BarsCount-counted_bars;i++) { TimeMain=Time[i]; iBarShift1=iBarShift(Currency1,Period(),TimeMain); iBarShift2=iBarShift(Currency2,Period(),TimeMain); ExtMapBuffer1[i]=iTime(Currency1,Period(),iBarShift1); ExtMapBuffer2[i]=iTime(Currency2,Period(),iBarShift2); ExtMapBuffer3[i]=(ExtMapBuffer1[i]-ExtMapBuffer2[i]); tt1=Time[i]-ExtMapBuffer1[i]; tt2=Time[i]-ExtMapBuffer2[i]; if (ExtMapBuffer3[i]!=0 || tt1!=0 || tt2!=0) { Bar1=iBarShift(Currency1,Period(),ExtMapBuffer1[i]); Bar2=iBarShift(Currency2,Period(),ExtMapBuffer2[i]); if (FileWrite (handle, i,TimeToStr(Time[i]),iBarShift1,Bar1,TimeToStr(iTime(Currency1,Period(),Bar1-1)),TimeToStr(ExtMapBuffer1[i]),TimeToStr(iTime(Currency1,Period(),Bar1+1)),iBarShift1,Bar2,TimeToStr(iTime(Currency2,Period(),Bar2-1)),TimeToStr(ExtMapBuffer2[i]),TimeToStr(iTime(Currency2,Period(),Bar2+1)) )<=0) Print("нифига не пишет!!"); } FileFlush(handle); if ((iTime(Symbol(),Period(),i)!=iTime(Currency1,Period(),i) || Time[i]!=iTime(Currency1,Period(),i) || iTime(Currency1,Period(),i)!=iTime(Currency2,Period(),i) ) && i>0) { if (FileWrite (handle2,i, TimeToStr(Time[i])," ",TimeToStr(iTime(Currency1,Period(),i))," ",TimeToStr(iTime(Currency2,Period(),i)) )<=0) Print("нифига не пишет!!"); } }//---- return(0); } //+------------------------------------------------------------------+