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

 

Admin hello

Please tell me - HOW does the VOLUME indicator (built in mt-4 terminal) work ??????

I noticed that it :

- shows the total tick volume of the bar,

- and colours the bars of the histogram in different colours.... and the colour of the bar does NOT ALWAYS correspond to the colour of the bar (!)

For example - a bar is BULL (green), and the histogram bar is colored in green, then in red ..... WHY SO ????????

HOW to understand this "junk" (ind.volume) ????????

........... here in the net (not even in the mt-4 terminal Help ) - I read that this indicator VOLUME colours bar graph sticks in different colours depending on how many ticks were down and how many were up .......

also ??????

---------------------------------
But then there is a POPULAR question = if we look at the TICK chart (e.g. Euro-Dollar), we see that the Bid and ASK price swings = DIFFERENT ... the Bid swings up and down more often.... the Ask more often up and down .....
THE BID QUESTION = does the ind.VOLUME take into account the individual fluctuations of Bid, and Ask ???

====================

Just different thoughts come to mind :

Thought #1 :

ind.VOLUME counts ONLY the Bid oscillations, = how many ticks were up and how many were down (?!) , and displays the result as a histogram stick colour = if there was more down, even on a green bar = the histogram stick will be RED (!).

Thought #2:

The ind.VOLUME counts ONLY = how many ticks were on Asc and how many ticks were on Bid (!)
E.g. = the Ask was 185 ticks, and the Bid = 245 ticks
Then a simple comparison = 245 > 185 , which means that the bar chart would be colored RED (even on a bull bar)
........... but this = COLORABILITY to normal bar colour = if Close is lower than Open = bar RED (and vice versa)........ then WHERE LOGIC ind.VOLUME ????????

I have no other reason, because I don't know how to read the indicator code (!)

.............. ADMIN - PLEASE PLEASE UNDERSTAND WHAT AND HOW the ind.VOLUME counts (???!?!!)

Thanks )

Справка по MetaTrader 5
Справка по MetaTrader 5
  • www.metatrader5.com
Поддерживаются четыре режима исполнения торговых ордеров: немедленный (Instant Execution), по запросу (Request Execution), по рынку (Market Execution) и биржевой (Exchange). В распоряжении трейдера все виды ордеров, включая рыночные, отложенные и стоп-ордера. Такое разнообразие в выборе ордеров и режимов их исполнения позволяет трейдеру...
 
Igor Makanu:

I sent one line at a time in a loop, added the lines to an array in the dll, and then applied the array of lines by calling another function

// Передача в DLL массива строк.

#include <TypeToBytes.mqh> // https://www.mql5.com/ru/code/16280

void DLL( const uchar &Bytes[] )
{
  ArrayPrint(Bytes);
  
  const int Size = ArraySize(Bytes);  
  string Str = NULL;
  
  for (int i = 0; i < Size; i++)
    if (Bytes[i])
      Str += CharToString(Bytes[i]);
    else
    {
      Print(Str);
      
      Str = NULL;
    }
}

void OnStart()
{
  const string Str[] = {"123", "4567"};
  
  DLL(_R(Str).Bytes);    
}
 
Vitaliy Kostrubko:

Admin hello

Please tell me - HOW does the VOLUME indicator (built in mt-4 terminal) work ??????

I noticed that it :

- shows the total tick volume of the bar,

- and colours the bars of the histogram in different colours.... and the colour of the bar does NOT ALWAYS correspond to the colour of the bar (!)

For example - a bar is BULL (green), and the histogram bar is colored in green, then in red ..... WHY SO ????????

HOW to understand this "junk" (ind.volume) ????????

........... here in the net (not even in the mt-4 terminal Help ) - I read that this indicator VOLUME colours bar graph sticks in different colours depending on how many ticks were down and how many were up .......

also ??????

---------------------------------
But then there is a POPULAR question = if we look at the TICK chart (e.g. Euro-Dollar), we see that the Bid and ASK price swings = DIFFERENT ... the Bid swings up and down more often.... the Ask more often up and down .....
THE BID QUESTION = does the ind.VOLUME take into account the individual fluctuations of Bid, and Ask ???

====================

Just different thoughts come to mind :

Thought #1 :

ind.VOLUME counts ONLY the Bid oscillations, = how many ticks were up and how many were down (?!) , and displays the result as a histogram stick colour = if there was more down, even on a green bar = the histogram stick will be RED (!).

Thought #2:

ind.VOLUME counts ONE = how many ticks were on Asc and how many ticks were on Bid (!)
E.g. = the Ask was 185 ticks, and the Bid = 245 ticks
Then a simple comparison = 245 > 185 , which means that the bar chart would be colored RED (even on a bull bar)

I have no other thoughts as I DO NOT KNOW how to read the indicator code (!)

.............. ADMIN - PLEASE PLEASE UNDERSTAND WHAT AND HOW the ind.VOLUME counts (????!!!)

Thanks )

It depends on the value relative to the previous bar. A value greater than the previous one will be green. Less than that, it will be red.

 
Hi all!
help me attach Alert
to the indicator!
it's a stochastic histogram! I need Alert to be triggered when it crosses the 0 line up and down!

Files:
 
fxsaber:

I did not want to run VS2017, but tried different ways, but I can not find out the size of the array of strings, as well as the size of memory occupied by the entire array, I tried both through sizeof() and through safe Marshal.SizeOf() - still you will crash ona critical error when determining the size of the occupied memory

Knowing number of elements, you can pass the array of strings, here's an example:

// MQL5

#property strict

#import "tstdllstring.dll"
#import
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   string s[10];
   for(int i=0;i<10;i++)
      s[i]="qwerty";
   tst::Replace(s,ArraySize(s));
   for(int i=0;i<10;i++)
      Print(s[i]);
  }
// C# VS2107
using System;

namespace tstdllstring
{
    public static class tst
    {
        public static void Replace(ref string[] s,int arraysize)
        {
            for (int i = 0; i < arraysize; i++)
            {
                string tmp = s[i];
                s[i] = tmp+ "123456789";
            }
        }
    }
}

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789

2019.07.24 19:43:53.867 tst____ (EURUSD,H1) qwerty123456789


SZY: I don't remember already, but it seems there's still a problem if you pass different given types and strings as parameters when calling dll functions, it seems you can't have multiple string arrays and many int's .... though I could be wrong - I'm confused with calling unmanaged code from under MQL4 - there it's hard to guess when and how it works, everything is very sensitive to any changes... I didn't think I would say this... but MQL5 is the power! - integrates with C# in "2 clicks" - I like simple solutions! ;)

Files:
 
      h=FileOpen("NS_w_"+Symbol()+Period()+"."+ext+"",FILE_WRITE|FILE_CSV,";");
                  for(int z6=0;z6<((vhodyClose+vhodyOpen+vhodyHigh+vhodyLow+vhodyVolume)*neiro);z6++)
                  {
                     double o=w[z6];
                     FileWrite(h,o);
                  }
                FileClose(h); //return;

This is how I save values of arrayw[z6] to txt file

   int handle;
   handle = FileOpen(FileName1, FILE_CSV|FILE_READ,";");
   if(handle>0)
   {  
      //FileReadArray(handle, w, 0, ((vhodyClose+vhodyOpen+vhodyHigh+vhodyLow+vhodyVolume)*neiro));
      FileReadArray(handle, w);
      int size=ArraySize(w);
         //--- распечатаем данные из массива
         for(int ii2=0;ii2<size;ii2++)
           {
           Print("w = ",w[ii2]);
           }
         Print("Total data = ",size);
         //--- закрываем файл   
      FileClose(handle);
   }

This is how I try to transfer data from text file tow[] array, but with another Expert Advisor. But I get zeros. Please help me to modify the code, I need to get the correct data from the file.

 
Alexey Viktorov:

It depends on the value relative to the previous bar. A value higher than the previous one will be green. Less than that, it will be red.

It turns out it's all so very simple?!

I thought there was some "higher mathematics" involved ! )????! :)

Got it, thanks )

 
Vitaliy Kostrubko:

It turns out it's all so very simple?!

I thought there was some "higher mathematics" involved ! )????! :)

Got it, thank you )

Ten years ago, if not more, I asked a similar question. Only on the AO indicator.))

And something similar to your assumptionshere
TicksVolume
TicksVolume
  • www.mql5.com
Индикатор показывает изменение цены в пунктах и сколько раз за период произошло изменение в течение выбранного периода, к сожалению только от момента запуска до момента остановки. Входящих параметров не имеет. Возможно использование для определения скорости и/или ускорения изменения цены. На скрине видно, что Volume равно 44, индикатор...
 

Has anyone worked with colours in this format?

C'128,128,128'
C'0x00,0x00,0xFF'


The first C'128,128,128' I understand is the intensity of the colour components. But what do the letters do in the second one? I've got it from MQL5 Reference in color type description.


Is there a possibility in MQL5 to make the indicator line very multicolored? For example, the RSI line, the colour of which will be affected by the RSI value, i.e., can the RSI value affect the intensity of one of the colour components? ...Hope you understood me))

 
Alexandr Sokolov:

Has anyone worked with colours in this format?


The first C'128,128,128' I understand is the intensity of the colour components. But what do the letters do in the second one? I've got it from MQL5 Reference in color type description.


Is there a possibility in MQL5 to make the indicator line very multicolored? For example, the RSI line, the colour of which will be affected by the RSI value, i.e. can the RSI value affect the intensity of one of the colour components? ...I hope you understood me))

1. The second example is the hexadecimal representation of numbers.
2. Can
Reason: