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.

Suche MACDBars.mq4

Geschrieben

Hallo,

 

hat jemand den MACD Bars Indikator ? Ich suche Ihn komme aber immer nur auf merkwürdige Seiten im Netz :cleanglasses:

 

So in etwa sollte er aussehen.

 

Vielen Dank.

 

MFG, B.

post-3488-0-23903000-1332174731_thumb.jpg

Featured Replies

Geschrieben

hat jemand den MACD Bars Indikator ?

Kannst du mal bitte erläutern was das gute Stück machen soll ? Rot ist unter der Mittellinie, Grün darüber ?

Vllt. hilft dir das auch schon ein wenig weiter MACD Histogramm usw.

Geschrieben

Habe dir den gewünschten Indikator mal rausgesucht.:door:

 

Code kopieren und dann im Meta Editor abspeichern.

 

bullet_go.png

//+------------------------------------------------------------------+
//|                                      MACDBars.mq4 modified from  |
//|                                              mtt-ErgodicMACD.mq4 |
//|                   Copyright © 2004-07, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2004-07, mietectec"
#property  link      ""
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 2
#property  indicator_color1  Lime
#property  indicator_color2  Red
#property indicator_width1 4
#property indicator_width2 4
#property  indicator_minimum 0
#property  indicator_maximum 1

// MACD
extern string note1 = "Chart Time Frame";
extern string note2 = "0=current time frame";
extern string note3 = "1=M1, 5=M5, 15=M15, 30=M30";
extern string note4 = "60=H1, 240=H4, 1440=D1";
extern string note5 = "10080=W1, 43200=MN1";
extern int	TimeFrame	= 0;		
extern string note6 = "MACD settings";
extern int FastEma = 12;
extern int SlowEma = 26;
extern int SignalSMMA = 9;
extern string note7 = "0=Close,1=Open,2=High,3=Low";
extern string note8 = "4=Median Price,5=Typical Price";
extern string note9 = "6=Weighted Price";
extern int PriceField = 0;
//extern string note10 = "Alert when cross over or down zero";
bool PopUpAlert=true;
bool EmailAlert=false;
extern string note11 = "Numbers of bars to calculate";
extern int MaximumBars=196; 

//---- indicator buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
string AlertPrefix;
string GetTimeFrameStr() {
  switch(TimeFrame)
  {
     case 1 : string TimeFrameStr="M1"; break;
     case 5 : TimeFrameStr="M5"; break;
     case 10 : TimeFrameStr="M10"; break;
     case 15 : TimeFrameStr="M15"; break;
     case 30 : TimeFrameStr="M30"; break;
     case 60 : TimeFrameStr="H1"; break;
     case 120 : TimeFrameStr="H2"; break;
     case 240 : TimeFrameStr="H4"; break;
     case 480 : TimeFrameStr="H8"; break;
     case 1440 : TimeFrameStr="D1"; break;
     case 10080 : TimeFrameStr="W1"; break;
     case 43200 : TimeFrameStr="MN1"; break;
     default : TimeFrameStr=Period(); break;
  } 
  return (TimeFrameStr);
  }

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
 {
  SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,4,indicator_color1);
  SetIndexBuffer(0,ExtMapBuffer1);
  SetIndexLabel(0,"BuyZone");
  
  SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,4,indicator_color2);
  SetIndexBuffer(1,ExtMapBuffer2);
  SetIndexLabel(1,"SellZone");
  if (TimeFrame == 0) TimeFrame = Period();
  IndicatorShortName(GetTimeFrameStr() + " MACD ("+FastEma+","+SlowEma+","+SignalSMMA+")");   
IndicatorDigits(0);
  AlertPrefix=Symbol()+" ("+GetTimeFrameStr()+"):  ";
  return(0);
 }
//+------------------------------------------------------------------+
int deinit()
 {
  return(0);
 }
//+------------------------------------------------------------------+
/*
bool NewBar()
{
  static datetime lastbar;
  datetime curbar = Time[0];
  if(lastbar!=curbar)
  {
     lastbar=curbar;
     return (true);
  }
  else
  {
     return(false);
  }
}   
*/
//+------------------------------------------------------------------+
int start()
 {
  datetime TimeArray[];
  int i, banzai, crossupzero, crossdownzero;
 
  crossupzero =0;
  crossdownzero=0;
  for (i=0, banzai=0; i<MaximumBars; i++)
      {
       ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
       if (Time[i]<TimeArray[banzai]) banzai++; 
       double indMacdMain0 = iMACD(NULL,TimeFrame,FastEma, SlowEma, SignalSMMA,PriceField,0,banzai);
       double indMacdSignal0 = iMACD(NULL,TimeFrame,FastEma, SlowEma, SignalSMMA,PriceField,1,banzai);
  
       if (indMacdMain0 >= indMacdSignal0) {
          ExtMapBuffer1[i] = 1;
          ExtMapBuffer2[i] = 0;
          crossupzero = crossupzero + 1;
          crossdownzero=0;
         }
       else if (indMacdMain0 < indMacdSignal0 ) {
          ExtMapBuffer2[i] = 1;
          ExtMapBuffer1[i] = 0;
          crossdownzero = crossdownzero + 1;
          crossupzero =0;
         }
/*
      if (PopUpAlert && NewBar ()) {
           if (crossupzero == 1 && NewBar ()) 
              Alert(crossupzero+AlertPrefix+" MACD ("+FastEma+","+SlowEma+","+SignalSMMA+") crosses UP zero\nBUY signal @ Ask = $",Ask,"; Bid = $",Bid,"\nDate & Time = ",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime()));
           if (crossdownzero == 1 && NewBar ()) 
              Alert(AlertPrefix+" MACD ("+FastEma+","+SlowEma+","+SignalSMMA+") crosses DOWN zero\nSELL signal @ Ask = $",Ask,"; Bid = $",Bid,"\nDate & Time = ",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime()));
      }
      if (EmailAlert) {
           if (crossupzero == 1) 
              Alert(AlertPrefix+" MACD ("+FastEma+","+SlowEma+","+SignalSMMA+") crosses UP zero\nBUY signal @ Ask = $",Ask,"; Bid = $",Bid,"\nDate & Time = ",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime()));
           if (crossdownzero == 1) 
              Alert(AlertPrefix+" MACD ("+FastEma+","+SlowEma+","+SignalSMMA+") crosses DOWN zero\nSELL signal @ Ask = $",Ask,"; Bid = $",Bid,"\nDate & Time = ",TimeToStr(CurTime(),TIME_DATE)," ",TimeHour(CurTime()),":",TimeMinute(CurTime()));
      }
*/
      }
     return(0);
 }
//+------------------------------------------------------------------+





 

Quelle des Codes

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.