Zum Inhalt springen
View in the app

A better way to browse. Learn more.

#T/N/X/T

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Verzogene H-Linien

Geschrieben

Weiß jemand wie man die nachgezogenen Linien weg bekommt, die sich auf dem Index 2 und nach Wochenschluss darstellen?

 

#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Blue
#property indicator_color4 Gray
double a_wo[];
double a_wl[];
double a_wh[];
double a_calc[];
int init()
{
SetIndexBuffer(0,a_wo);
SetIndexBuffer(1,a_wl);
SetIndexBuffer(2,a_wh);
SetIndexBuffer(3,a_calc);
SetIndexStyle(0,DRAW_LINE,0,2);
SetIndexStyle(1,DRAW_LINE,0,2);
SetIndexStyle(2,DRAW_LINE,0,2);
SetIndexStyle(3,DRAW_LINE,0,2);
SetIndexLabel(0,"");
SetIndexLabel(1,"");
SetIndexLabel(2,"");
SetIndexLabel(3,"");
return(0);
}
int deinit()
{
ObjectDelete("");
ObjectDelete("");
ObjectDelete("");
return(0);
}
int start()
{
int i,counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
int limit=Bars-counted_bars;
if(Period()>PERIOD_H4) return(-1);
double last_week_low,last_week_high;
for(i=limit-1; i>=0; i--)
{
// 1sts Days of Week
if(TimeDayOfWeek(Time[i])<=2 && TimeDayOfWeek(Time[i+1])>=4)
{
//we are at the first bar of the week, means nearest bar in W1 is this weeks bar
int shift= iBarShift(Symbol(),PERIOD_W1,Time[i],false);
double wo = iOpen(Symbol(), PERIOD_W1, shift+1);
double wh = iHigh(Symbol(), PERIOD_W1, shift+1);
double wl = iLow(Symbol(), PERIOD_W1, shift+1);
double calc = iOpen(Symbol(), PERIOD_W1, shift+1)-(iOpen(Symbol(), PERIOD_W1, shift+1)-iLow(Symbol(), PERIOD_W1, shift+1));

}
a_wo[i]=wo;
a_wl[i]=wl;
a_wh[i]=wh;
a_calc[i]=(wh+wl)/2;
Comment(calc);
}
//----
return(0);
}

post-1524-0-51207100-1343816620_thumb.png

Featured Replies

Geschrieben

SetIndexEmptyValue(0,EMPTY_VALUE);

...

SetIndexEmptyValue(3,EMPTY_VALUE);

Wenn Du in init() die Indizes mit EMPTY_VALUE initialisierst, sollte an diesen Stellen nichts mehr angezeigt werden

Geschrieben
  • Autor

Ich habe mal die For Schleife umgestellt, leider beginnt die Woche nun grafisch an der vorhergehenden Woche. Habe schon mit +1 etc. herumversucht, ohne Erfolg. Kann da mal jemand kurz drübersehen?

 

#property indicator_chart_window

#property indicator_buffers 4

#property indicator_color1 Red

#property indicator_color2 Green

#property indicator_color3 Blue

#property indicator_color4 Gray

 

double a_wo[];

double a_wl[];

double a_wh[];

double a_calc[];

int init()

{

SetIndexBuffer(0,a_wo);

SetIndexBuffer(1,a_wl);

SetIndexBuffer(2,a_wh);

SetIndexBuffer(3,a_calc);

SetIndexStyle(0,DRAW_LINE,0,2);

SetIndexStyle(1,DRAW_LINE,0,2);

SetIndexStyle(2,DRAW_LINE,0,2);

SetIndexStyle(3,DRAW_LINE,0,2);

SetIndexLabel(0,"");

SetIndexLabel(1,"");

SetIndexLabel(2,"");

SetIndexLabel(3,"");

SetIndexEmptyValue(0, EMPTY_VALUE);

SetIndexEmptyValue(1, EMPTY_VALUE);

SetIndexEmptyValue(2, EMPTY_VALUE);

SetIndexEmptyValue(3, EMPTY_VALUE);

return(0);

}

 

int deinit()

{

ObjectDelete("");

ObjectDelete("");

ObjectDelete("");

 

return(0);

}

 

int start()

{

int i,counted_bars=IndicatorCounted();

//---- check for possible errors

if(counted_bars<0) return(-1);

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

int limit=Bars-counted_bars;

if(Period()>PERIOD_H4) return(-1);

double last_week_low,last_week_high;

 

for(i=0; i<=Bars; i++)

{

// 1sts Days of Week

if(TimeDayOfWeek(Time)<=2 && TimeDayOfWeek(Time[i+1])>=4)

{

//we are at the first bar of the week, means nearest bar in W1 is this weeks bar

int shift= iBarShift(Symbol(),PERIOD_W1,Time,false);

 

 

 

 

 

 

 

 

 

}

 

 

double wo = iOpen(Symbol(), PERIOD_W1, shift );

a_wo = wo;

a_calc=iLow(Symbol(), PERIOD_W1, shift);

 

 

 

Comment(wo);

 

}

//----

return(0);

}

post-1524-0-42009700-1343823101_thumb.png

Geschrieben
  • Autor
Gelöst..... if(TimeDayOfWeek(Time)<=2 && TimeDayOfWeek(Time[i+1])>=4) war hier unangebracht.

Dein Kommentar

Du kannst jetzt schreiben und Dich später registrieren. Wenn Du ein Konto hast, melde Dich jetzt an, um unter Deinem Benutzernamen zu schreiben.

Gast
Auf dieses Thema antworten...

Account

Navigation

Suche

Suche

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.