[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 232

 

Thank you for your prompt reply, but unfortunately this is all missing in the masd. The MA method is strictly set. no possibility to change, neither is the price type.

I'm talking about the standard MASD which is in the terminal. Maybe you mean some other one ? With advanced user settings?

 
The MA method is indeed strictly set, but it is the most 'correct' method. The price type, on the other hand, has a wide choice. There are no colours, though. But are they really needed?
 

I agree with you about the colour, but I would like to be able to change the MA method. Maybe you can tell me how to do it correctly. For example, if through the meta-editor copy part of the code, which is responsible for the MA method from the aligator (for example) and paste it into the MASD code? Or is it still a crazy idea?

 
kiroyama:

Maybe you can tell me how to do it right.

I will and I ask you to take the advice seriously. It's worth learning how to program. It is not as difficult as it may seem. The benefits will be enormous!
 

Good afternoon! A week ago - more than a week - I started to understand how to write indicators and decided to write at least something. Okay, there's nothing in the code. But it doesn't even draw a line!!! I don't know where, but I can't see any signs of indicator's life, as they say!!!!!!.

I may not have written it something important, some kind of command to draw a line... Russian layout - well, it's convenient for me so for

//+------------------------------------------------------------------+
//|                                          поиск вульфа Димона.mq4 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_chart_window

#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
double ВерхняячертаBuffer1[];
double НижняячертаBuffer2[];

 double вершина; 
 double основание_первого_снижения;
 double начало;
 double вершина_волны_3;
 
 int timeframe, start ;
 int бар_вершина ;
 int бар_основание_первого_снижения;
 int бар_начало;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()

  {SetIndexStyle(0,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(0,ВерхняячертаBuffer1);Alert ("SetIndexBuffer ",GetLastError( ) );
   SetIndexEmptyValue(0,0.0);
   
   SetIndexStyle(1,DRAW_SECTION,STYLE_SOLID,2,CLR_NONE);Alert ("SetIndexStyle ",GetLastError( ) );
  SetIndexBuffer(1,НижняячертаBuffer2);Alert ("SetIndexBuffer ",GetLastError( ) ); 
   SetIndexEmptyValue(1,0.0);
//---- indicators




//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----

  // for(int i=Bars; i>=0;i--)
  int i=Bars;
       бар_вершина=iHighest( NULL,  timeframe, MODE_HIGH, i, start ) ;
       вершина =High[ бар_вершина ];
       бар_основание_первого_снижения=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина, start ) ;
       основание_первого_снижения=Low[ бар_основание_первого_снижения ];
       бар_начало=iLowest( NULL,  timeframe, MODE_LOW, бар_вершина*2, бар_вершина ) ;
       начало=Low[ бар_начало ];
       
         
  
    НижняячертаBuffer2[бар_начало]=начало;
    НижняячертаBuffer2[бар_основание_первого_снижения]=основание_первого_снижения;
    
     int бар_проверка=iLowest( NULL,  timeframe, MODE_LOW, 5, 150 ) ;
     double проверка=Low[ бар_проверка ];
    ВерхняячертаBuffer1[бар_проверка]=проверка;
    ВерхняячертаBuffer1[бар_основание_первого_снижения]=основание_первого_снижения;
    
//----
   return(0);
  }
//+------------------------------------------------------------------+

myself.

 
kiroyama:

I agree with you about the colour, but I would like to be able to change the MA method. Maybe you can tell me how to do it correctly. For example, if through the meta-editor copy part of the code, which is responsible for the MA method from the aligator (for example) and paste it into the MASD code? Or is it still a crazy idea?

We can use the code ofMetaQuotes to substitute the appropriate MA for MACD and the price as well. I have recently posted an indicator for Bollinger with possibility to set MA and prices. If you are interested in such modification for MACD, on the basis of description of MetaQuotes calculation formula write me in your personal message where and how to modify it.

 

Too much is written in your first indicator for it to work properly.
In fact, start with a simpler one. Draw a horizontal line.
An indicator without a cycle is like a wedding night without a bride.
Put in a loop and throw out 80 percent of the sides.

 

Thank you. But yes, I know code-ahinea, and I want to, exactly, And actually, start with something simpler. Draw a horizontal line.

And it's not showing any signs of life!!! Well, not horizontal, whatever!!! I've defined two buffers, I've defined the line style in the Inite, I've linked the buffers to the arrays... I don't want to see a line! That's the point!

Please, who knows, maybe I wrote SetIndexStyle wrong, or something... or something... I set two points for the line

TopBuffer1[bar_check]=check;
TopBuffer1[bar_base_first_decrease]=base_first_decrease; What else?

 
A line consists of points. Find a place in your program that specifies how many points to draw.
 
Thank you!
Reason: