Kann man einen Jahres Kerzen Indikator in einen Quartals Indikator umprogrammieren?

Einloggen oder registrieren, um einen Kommentar zu schreiben
MAG298
27
MAG298  

Wenn jemand mir einen Tipp geben kann, bitte um Info. Welche Werte miss man da ändern?

Danke im Voraus.

//+------------------------------------------------------------------+
//|                                                  Heiken Ashi.mq4 |
//|                      Copyright c 2004, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
//|                        INDONESIA RAYA                            |
//| For Heiken Ashi we recommend next chart settings ( press F8 or   |
//| select on menu 'Charts'->'Properties...'):                       |
//|  - On 'Color' Tab select 'Black' for 'Line Graph'                |
//|  - On 'Common' Tab disable 'Chart on Foreground' checkbox and    |
//|    select 'Line Chart' radiobutton                               |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2004, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window
//----
int ExtCountedBars=0;


extern color  colorUp = SteelBlue;
extern color  colorDown = Red;

int data = 1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//|------------------------------------------------------------------|
int init()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
   ObjectsDeleteAll(0,"Yearly");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   if(data != 1) return(0);
   double haOpen, haHigh, haLow, haClose;
   if(Bars<=10) return(0);
   ExtCountedBars=IndicatorCounted();
//---- check for possible errors
   if (ExtCountedBars<0) return(-1);
//---- last counted bar will be recounted
   if (ExtCountedBars>0) ExtCountedBars--;
   int pos=Bars-ExtCountedBars-1;
   int i;
  
   datetime startmonth = Time[pos];
   datetime endmonth;
   datetime timewick;

   int firstyear = TimeYear(Time[pos]);
   int thisyear  = TimeYear(TimeCurrent());
   int year      = thisyear - firstyear;
   int yeardummy = year;
  
   int theyear;
   int yeartemp;
  
  
  
   for(i=thisyear; i>= firstyear; i--)
      {
       ObjectCreate("Yearly Body"+i,      OBJ_RECTANGLE, 0, 0,0, 0,0);
       ObjectCreate("Yearly Shadow Up"+i, OBJ_TREND, 0, 0,0, 0,0);
       ObjectCreate("Yearly Shadow Dn"+i, OBJ_TREND, 0, 0,0, 0,0);
      }

   while(pos>=0)
        {
         theyear    = TimeYear(Time[pos]);
         haOpen     = Open[pos];
         haClose    = haOpen;
         haHigh     = haOpen;
         haLow      = haOpen;
         startmonth = Time[pos];
         timewick   = Time[pos] + 7 * 60 * 43200;

         while(theyear == TimeYear(Time[pos]))
              {
               haHigh   = MathMax(haHigh, High[pos]);
               haLow    = MathMin(haLow,  Low[pos]) ;
               haClose  = Close[pos];
               yeartemp = theyear;
               endmonth = Time[pos];
               pos--;
              }       
         
      ObjectSet("Yearly Body"+yeartemp, OBJPROP_TIME1,  startmonth);
      ObjectSet("Yearly Body"+yeartemp, OBJPROP_PRICE1, haOpen);
      ObjectSet("Yearly Body"+yeartemp, OBJPROP_TIME2,  endmonth);
      ObjectSet("Yearly Body"+yeartemp, OBJPROP_PRICE2, haClose);
      ObjectSet("Yearly Body"+yeartemp, OBJPROP_STYLE,  STYLE_SOLID);
      ObjectSet("Yearly Body"+yeartemp, OBJPROP_WIDTH,  2);
     
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_TIME1,  timewick);
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_PRICE1, haHigh);
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_TIME2,  timewick);
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_PRICE2, MathMax(haOpen,haClose));
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_STYLE,  STYLE_SOLID);
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_WIDTH,  4);
      ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_RAY,    False);           
 
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_TIME1,  timewick);
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_PRICE1, MathMin(haOpen,haClose));
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_TIME2,  timewick);
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_PRICE2, haLow);
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_STYLE,  STYLE_SOLID);
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_WIDTH,  4);
      ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_RAY,    False);           


      if(haOpen < haClose)
        {
         ObjectSet("Yearly Body"     +yeartemp, OBJPROP_COLOR, colorUp);
         ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_COLOR, colorUp);
         ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_COLOR, colorUp);
        }
      else
        {
          ObjectSet("Yearly Body"     +yeartemp, OBJPROP_COLOR, colorDown);
          ObjectSet("Yearly Shadow Up"+yeartemp, OBJPROP_COLOR, colorDown);
          ObjectSet("Yearly Shadow Dn"+yeartemp, OBJPROP_COLOR, colorDown);
        }

           yeardummy--;
        }
//----
   data = 2;
   return(0);
  }
//+------------------------------------------------------------------+

MetaQuotes Software Corp.
MetaQuotes Software Corp.
  • www.metaquotes.net
Millions of traders and hundreds of brokers cannot be wrong — they have chosen MetaTrader 5 for trading Forex and financial markets! Learn more
MAG298
27
MAG298  
Wenn es möglich ist das er 3 Monatskerzen anzeigt, bitte im Tipps wie?
Carl Schreiber
Moderator
7393
Carl Schreiber  
Erstelle grafische Objekte (Rechtecke) die drei Monate umfassen..
Einloggen oder registrieren, um einen Kommentar zu schreiben