Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 855

 
Question withdrawn. I apologise for littering the forum without reading the previous questions. It's been asked 500 times already. The answer is clear. And thank you tara for the answer.
 

Hello, Task: Through an indicator.

- Place (for example - PLOT_ARROW) taking price values from a two-dimensional array.tmparray[][],

- Place (PLOT_ARROW) quantity>1 on one candle,

i.e. I can place one cross per candle (usingtmparray[]), i need more>1

//--- indicator buffers mapping
   SetIndexBuffer(0,tmparray);
//--- setting a code from the Wingdings charset as the property of PLOT_ARROW
   PlotIndexSetInteger(0,PLOT_ARROW,159);
   
   ArrayResize(tmparray, CountMA+1);
   //SetIndexBuffer(1,scBuf);

 
Top2n:

Hello, Task: Through an indicator.

- Place (for example - PLOT_ARROW) taking price values from a two-dimensional array.tmparray[][],

- Place (PLOT_ARROW) quantity>1 on one candle,

i.e. I can place one cross per candle (usingtmparray[]), i need more>1

Why don't you make a histogram first. It will be clearer
 
Top2n:

Hello, Task: Through an indicator.

- Place (for example - PLOT_ARROW) taking price values from a two-dimensional array.tmparray[][],

- Place (PLOT_ARROW) quantity>1 on one candle,

i.e. I can place one cross per candle (usingtmparray[]), i need more>1

If eight crosses on each bar is enough, then no problem, otherwise it's on MQL5.
 
tara:
If eight crosses on each bar is enough, then no problem, otherwise go to MQL5.
And mql4 does not limit the number of buffers now either.
 
AlexeyVik:
And mql4 doesn't limit the number of buffers now either.
Yes? Thanks, I'm still in the process of sewing :)
 
Hello. These questions are addressed to experienced ATC nicknames.
1. What characters the algorithm should have in order to
What number of deals should the Expert Advisor make in the Strategy Tester?
The Expert Advisor, on what time interval.
2. whether there are algorithms that demonstrate stable results for 10 or more years. 3.
3. What is needed to stably earn by trading using Expert Advisors?
look for algorithms, which have been working in the Strategy Tester for dozens of years, or concoct a couple of dozens of algorithms
which have shown results over a short period of time, combine them into one EA
and periodically change those that start to fail.
The answers to these questions, I think, will be interesting and important for all beginners
understand what direction to take.

 
AlexeyVik:
Yes and mql4 does not limit the number of buffers now.
Can you please tell me how to implement it!?!?
 
Top2n:
Please tell me how to implement it!?

I didn't give an answer to your question at all. Not even an answer, but an observation. To give you advice you need to understand what you want to get. And I don't.

If it's an indicator, then two-dimensional arrays don't apply there. If it's a simple custom array, it cannot be used as an indicator buffer. In order to get 2 indicator values on one candlestick, you should have 2 buffers, each of them should have a value that differs from each other. Otherwise, one will be hidden under the second one.

 
//+------------------------------------------------------------------+
//|                                                         SSMA.mq4 |
//|                                            Copyright 2014, Vinin |
//|                                             http://vinin.ucoz.ru |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, Vinin"
#property link      "http://vinin.ucoz.ru"
#property version   "1.00"
#property strict
#property indicator_chart_window
#property indicator_buffers 8
#property indicator_plots   1
//--- plot average
#property  indicator_label1  "average"
#property  indicator_type1   DRAW_ARROW
#property  indicator_color1  clrRed
#property  indicator_style1  STYLE_SOLID
#property  indicator_width1  1
//--- input parameters
extern int      CountMA=200;
extern int      Period_start =1;
extern int      Period_shift =5;
//--- indicator buffers
double         averageBuffer[];
double         maxBuffer[];
double         minBuffer[];
double         Label1Buffer[];
double         scBuf[][2];

double tmparray[],tmparrayF1[];
//double tmparrayD[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
  // массив tmparrayF1[] является индикаторным буфером
   SetIndexBuffer(0,tmparrayF1);
   PlotIndexSetInteger(0,PLOT_ARROW,159);
   
   ArrayResize(tmparray, CountMA+1);  // массив для рассчитанных SMA 
   ArrayResize(scBuf, CountMA+1);     // массив для значений повторений на цене  
   ArrayResize(tmparrayF1, CountMA+1); // массив для перевода в одномерный массив для отображения на графике

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   if (rates_total<Period_start+Period_shift*CountMA+1) return(0);
   ArrayInitialize(tmparray,0);
   ArrayInitialize(scBuf,0);
   
   int limit=rates_total-prev_calculated;
   if (limit>1) limit=rates_total-(Period_start+Period_shift*CountMA+1);
   
   double min=-99999,max=99999, sum=0;
   int count, countMA,schet;
   
   for (int i=limit;i>=0;i--)
   {
      sum=0;
      count=0;
      countMA=0;
      // формируем массив со значения машек
      for (int j=0;j<Period_start+Period_shift*CountMA;j++)
      {
         sum+=(High[i+j]+Low[i+j])*0.5;
         count++;
         if (count==Period_start+Period_shift*countMA)
         {
            tmparray[countMA]=sum/count;
            countMA++;
         }          
      }    
      // Массив создан. Можно обрабатывать
   }
 //***** Рассчитать количество повторений SMA, в десятичном интервале.
   for (int b=0;b<CountMA;b++)
   {
     schet=0;
     for (int a =CountMA;a>=0;a--) 
     {
       if(NormalizeDouble(tmparray[a],4)==NormalizeDouble(tmparray[b],4)&&tmparray[a]!=0) // 1.30000 = 1.30004
       {
         scBuf[b][0]=schet;                       // количество повторений МА
         scBuf[b][1]=tmparray[b];                 // Цена
         tmparray[a]=0;                           // Обнуляем посчитанную ячейку
         schet++;
       }
     } 
   }
   
   ArraySort(scBuf,WHOLE_ARRAY,0,MODE_DESCEND);   // Сортируем массив по убыванию
  
   for (int x=0;x<CountMA;x++) 
   {
     tmparrayF1[x]=scBuf[x][1];           //переносим значения цены в одномерный массив, для отображения через индикатор
   }  
     
      
Print("rates_total = ",rates_total,
"tmparray = ",tmparray[0]
,"KolVBuf ", scBuf[0][0],"+",scBuf[0][1]
       ,"/ ",scBuf[1][0],"+",scBuf[1][1]
       ,"/ ",scBuf[2][0],"+",scBuf[2][1]
       ,"/ ",scBuf[3][0],"+",scBuf[3][1]
       ,"/ ",scBuf[4][0],"+",scBuf[4][1]
       ,"/ ",scBuf[5][0],"+",scBuf[5][1]
     );

   
//--- return value of prev_calculated for next call
   return(rates_total);
  }

I apologise in advance to the admins for trolling, a similar question is in a separate thread https://www.mql5.com/ru/forum/154928,!))

Objective:

- Create an array of 2,000 moving average values.

- To mark with crosses, seals formed from the joined SMAs.

The result is that the crosses are scattered disordered and there is nothing.

Question:

It turns out that the error that causes the crosses to be placed in a way that does not correspond with the position of the SMA aggregate, is in the formation of the SMA array || ...?

Reason: