Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 358

 
STARIJ:


The indicator only displays information from the start. In the Data window (Ctrl-D) the data of the candle to which the cursor is pointing is displayed


Thank you. Huge.

 
STARIJ:
And the start lives and will live...
I don't know, I don't know... We shall see.
 
Artyom Trishkin:

When you paste the code in here, use the SRC post editor button - there are lots of useful features in the post formatting panel at the top of the post box.

It's not hard to raise your eyes just above the text you're typing, is it? And it's much more pleasant for people to look at normal code, isn't it?

I inserted your code for you in your message correctly (SRC)

What is ( SRC ) ?
YarTrade:

Thank you. I'll try it now. I understood the essence of your code, and it is already a great achievement for me :) I see my own shortcomings.

What is SRC button?

 
Vitaly Muzichenko:
What is ( SRC ) ?
It is an acronym for" source".
 
Artyom Trishkin:
Source- "source".

The translation is understandable.

You as a moderator - smart, beautiful, rich, show at least one post in which the source is inserted through this very button. I somehow constantly see only code, maybe I am looking in the wrong place.

Often code is inserted without the button on the grounds that its meaning is not clear, and then read the quill, and moderators still work with editing these quills.

 
Vitaly Muzichenko:

The translation is understandable.

You as a moderator - smart, beautiful, rich, show at least one post in which the source is inserted through this very button. I somehow constantly see only code, maybe I am looking in the wrong place.

Often insert code without the button because its meaning is not clear, and then read the quilt, and moderators still work with editing these quilts.

My very first time I inserted the code as text :))

Then I was prompted. True, I immediately asked a question - why I could not insert the code in human way.

They told you they'd think over your suggestion. And when the result of this "thinking" will be - but who knows...

I wonder if people in English branch do not know the meaning of button SRC, they - I wonder - also need to submit it as a CODE?

 
Vitaly Muzichenko:

As an old user of coder forums, I see CODE button almost everywhere, on super-multiprogram forums, everything is beautiful there, and just try to insert code via .op =)


Our code type is 99.9% mql, so one button is enough, but the right one, not srz(source)

PS. And of course, very lacking spoiler, so that the scrolls in 3 monitor hid.

Except that this post is not here, and inthe "How do you like the new look of the site

 
Artyom Trishkin:

Except this post shouldn't be here, it should be in"What do you think of the new design of the site".

Move it please, I'm really confused(

 
Comments not related to this topic have been moved to "What do you think of the new look of the site?".
 

Good afternoon.

Very much need your help. I am trying to describe the following logic for the indicator: If a tick is positive (bid-bid1), then the volume of this tick is added to the accumulated volume of all positive ticks for this bar. Volumes for negative ticks are added separately. A histogram is drawn where the amount of deals with positive ticks is increased and the amount of negative deals is decreased for each bar of the selected timeframe.

This is how my code works:

datetime Время=0;   // Время прошлого бара
double Bid1;
double   Buf_1[], Buf_2[]; // 2 буфера
int Volume1; // величина объема для бара на предыдущем тике
int V1; // объем для текущего тика вверх
int V2; // накопленный объем для всех тиков вверх текущего бара
int V3; // накопленный объем для всех тиков вниз текущего бара

void OnInit()
{
   IndicatorDigits(0);
   SetIndexBuffer(0,Buf_1);
   SetIndexBuffer(1,Buf_2);
   Bid1=Bid;
   Volume1 = iVolume(NULL, 0, 0);
   
}
 
 
//+------------------------------------------------------------------+
//| 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[])
{
   datetime Вр=Time[0];   // Время текущего бара
   if(Вр>Время)           // Если новый бар
   {
      Время=Вр;           // Запомнить
      Buf_1[0]=0;         // и обнулить последний элемент буфера
      Buf_2[0]=0;
   }

   if(Bid > Bid1) 
   {
   V1 = (iVolume(NULL, 0, 0) - Volume1)
   Buf_1[0]= (V1 + V2);
   }                             
   else 
   {
   V1 = (iVolume(NULL, 0, 0) - Volume1)
   Buf_2[0]= (V1 + V3);
   }
   Bid1=Bid;
   V2 = (V1 + V2);
   V3 = (V1 + V3);                      

  return(rates_total);
}

However, it contains compilation errors:
'Buf_1' - some operator expected VolumeCounter.mq4

Something I don't understand at all.


Reason: