Discussion of article "Implementing a Scalping Market Depth Using the CGraphic Library" - page 2

 
Konstantin Seredkin:

Can you tell me how to find the price of the maximum volume in the glass in your implementation? I found the volume itself, everything is clear, but how to find its price at which this maximal density stands.

I am interested in the software implementation? The price scalper is based on the CMarketBook class. It allows you to get common properties including the price of the max volume.
 
Vasiliy Sokolov:
Interested in a software implementation? The price scalper is based on the CMarketBook class. It allows you to get common properties, including the price of maximum volume.

Aha, in this class found the maximum volume itself, I am interested in how to complement it that it would also determine the price from the found max volume.

The topic is just interesting, for example, you can make an indicator, in which there will be a variable Volume = 1000, as soon as the closest to the price volume >=1000 appears in the glass on the chart at this price appears a bar. You can make a lot of interesting things, I wonder if it is possible to expand the funcional class, I see there are some data that your stack does not use, OI and maximum values for opening orders in both directions, etc. is also a necessary thing, but the price is not.... if you will add it I will be grateful or direct, I have never worked with stack data, but here I came across your topic and became interested, besides you have everything so conveniently played out.

 

Good evening, Vasily

I was so interested in the article that I decided to register and leave my comment (#1).

I am trying to get into algo-trading, but I still feel like a beginner.

I ran the attached code in tester mode to familiarise myself with its work. But for some reason the bet is not displayed in full, namely the frame and the legend on the right is opened, but the chart and buttons are missing. The tester works, there is no indication of an error in the log. What did I do wrong? Help me to connect.

Thanks in advance,

Alexander

 
AMK_robot:

Good evening, Vasily

I was so interested in the article that I decided to register and leave my comment (#1).

I am trying to get into algo-trading, but I still feel like a beginner.

I ran the attached code in tester mode to familiarise myself with its work. But for some reason the bet is not displayed in full, namely the frame and the legend on the right is opened, but the chart and buttons are missing. The tester works, there is no indication of an error in the log. What have I done wrong? help me to connect.

Thanks in advance,

Alexander

Good afternoon. Thank you for your interest in the article and our community. The answer to your question is hidden in it. The strategy tester does not represent the history of the bet, so you can run the bet only on a chart in the real-time mode. Besides, in the testing mode, graphical components are displayed with limited functionality, so you will not be able to display the price stack in the tester anyway. Use the price glass only on a chart. Besides, the price glass is not broadcast for all markets, so you should connect to the Moscow Exchange or use a MetaQuotes demo account.

 

Thank you Vasily for your work, a month ago implemented your class in my robots, of course, did not do without global improvements as some methods were missing, but everything worked out and works.

I have a question

Your example

//+------------------------------------------------------------------+
//|MarketBook.mq5 |
//| Copyright 2017, MetaQuotes Software Corp. | |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots 0
#include <MarketBook.mqh>

CMarketBook MarketBook.mqh
double fake_buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int OnInit()
  {
   MarketBook.SetMarketBookSymbol(Symbol());
//--- indicator buffers mapping
   SetIndexBuffer(0,fake_buffer,INDICATOR_CALCULATIONS);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| MarketBook change event|
//+------------------------------------------------------------------+
void OnBookEvent(const string &symbol)
{
   if(symbol != MarketBook.GetMarketBookSymbol())
      return;
   MarketBook.Refresh();
   ChartRedraw();
}

What is the correct way to de initialise the cup?

Which variant is more correct, it seems to work both ways

void OnDeinit(const int reason)
 { 

//|----------- 
   if(!MarketBookRelease((string)m_book_market.SetMarketBookSymbol(Symbol())))
   {
   if(Debug){Print("Error MarketBookRelease ",m_symbol.Name());}}
//|-----------


//|----------- 
   if(!m_book_market.SetMarketBookSymbol(Symbol()))  
   {
   if(Debug){Print("Error MarketBookRelease ",m_symbol.Name());}}
//||-----------

 }
 
Konstantin Seredkin:

Thank you Vasily for your hard work, a month ago I implemented your class in my robots, of course it did not do without global improvements as some methods were missing, but everything worked out and works.

I have a question

Your example

And what is the correct way to de initialise the tumbler

Which option is more correct, it seems to work both ways

I don't get it. What's this?

CMarketBook MarketBook.mqh
 
Konstantin:

I don't get it, what's this:

Some line of code...
 
Konstantin Seredkin:
Some line of code...

You showed me this code, so I'm asking what it is, because the syntax is not clear.

//+------------------------------------------------------------------+
//|MarketBook.mq5 |
//| Copyright 2017, MetaQuotes Software Corp. | |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2017, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#property indicator_chart_window
#property indicator_buffers 0
#property indicator_plots 0
#include <MarketBook.mqh>

CMarketBook MarketBook.mqh
double fake_buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int OnInit()
  {
   MarketBook.SetMarketBookSymbol(Symbol());
//--- indicator buffers mapping
   SetIndexBuffer(0,fake_buffer,INDICATOR_CALCULATIONS);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| MarketBook change event|
//+------------------------------------------------------------------+
void OnBookEvent(const string &symbol)
{
   if(symbol != MarketBook.GetMarketBookSymbol())
      return;
   MarketBook.Refresh();
   ChartRedraw();
}
 
Konstantin:

You showed me this code, so I'm asking you what it is, because the syntax is not clear.

Don't the words I wrote in my question mean anything?

Your example

This code is published by the author of the topic in the description of the class https://www.mql5.com/en/articles/3336.

So this question should not be addressed to me at least...

Пишем скальперский стакан цен на основе графической библиотеки CGraphic
Пишем скальперский стакан цен на основе графической библиотеки CGraphic
  • 2017.06.23
  • Vasiliy Sokolov
  • www.mql5.com
Именно с этой, улучшенной и дополненной версией мы и начнем работать, чтобы постепенно превратить ее в скальперский стакан цен. Краткий обзор графической библиотеки CPanel Созданию пользовательских интерфейсов в MQL5 посвящено много статей. Среди них особенно выделяется серия Анатолия Кажарского "Графические интерфейсы", после которой сложно...
 

Must be copypasta. It happens. The author most likely wrote this code partially in the browser.

Instead of

CMarketBook MarketBook.mqh

write

CMarketBook MarketBook;