Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1357

 

Question from the Administration.

Please help me download the demo version of Osiris.

When I try to download it, it won't download.

Купите Торговый робот (Expert Advisor) 'Astroloqer' для MetaTrader 4 в магазине MetaTrader Market
Купите Торговый робот (Expert Advisor) 'Astroloqer' для MetaTrader 4 в магазине MetaTrader Market
  • www.mql5.com
Советник Звездочет 1.0 универсал. НЕ мартинит НЕ усредняется И не торгует сетками ордеров. Терминал МТ4. Это вы можете сами проваерить при
 
Oleg Kolesov #:
The main question remains unresolved. How to colour the buffer with two colours. >= Blue to <= Red.

I can't understand your terms and conditions.

Example. Border = 5

Value == 8, colour blue.

Value == 1, colour - red.

Value == 5, colour - what?

 
Oleg Kolesov #:
Gonna take a break. Thank you.

slightly modified your indicator (it has an Expert Advisor for the tester)

Screenshot 2021-10-12 071433

Files:
V2.mq5  9 kb
 
SanAlex how do you rate?
 
Oleg Kolesov #:
SanAlex how do you rate it?

ordinary as anything - an expert, with all the trimmings, will make money.

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

EUR\USD-H2 Your indicator on the 2 o'clock stands in the down direction - at the moment neutral waiting to switch up or continue moving down.

EURUSDH2it

 
Why can the Print command not be logged?
 
Evgeny Dyuka #:
Why can the Print command not be logged?

The protection against ... The user's actions are not correct. Right-click in the terminal, in the "Experts" tab and run the "View" command.

 

Hello Gentlemen and Gentlemen!

Don't throw your thumbs up for my question. I understand that it is naive, but we all are "God, how naive we were" (romance).

I wrote an Expert Advisor using the original algorithm. Testing shows that it is most effective in scalper mode. I am not going to tell you the results because we all know the inventors of Perpetuum Mobile and Grails. It is neither one nor the other and it has a serious disadvantage - it depends on spread and commission values and stop loss like all scalper strategies. I have only one setting - SL and it has 6-10 pps on 5 signs. Can you enlighten me how to deal with it or which broker I can play these games with.

 
Hello.
There is an indicator. It sums up the limit orders in the cup and displays this as a chart.
#property indicator_separate_window
#property indicator_buffers 2
#property indicator_plots 2

#property indicator_label1 "Delta buy"
#property indicator_type1 DRAW_HISTOGRAM
#property indicator_color1 clrWhite
#property indicator_width1 3

#property indicator_label2 "Delta sell"
#property indicator_type2 DRAW_HISTOGRAM
#property indicator_color2 clrBlue
#property indicator_width1 3

int iStart;
double iDelta1[];
double iDelta2[];

void OnDeinit(const int reason)
{
  string symbol = Symbol();

  MarketBookRelease(symbol);
}

void OnInit()
{
  string symbol = Symbol();

  SetIndexBuffer(0, iDelta1, INDICATOR_DATA);
  ArraySetAsSeries(iDelta1, true);
  
  SetIndexBuffer(1, iDelta2, INDICATOR_DATA);
  ArraySetAsSeries(iDelta2, true);

  IndicatorSetString(INDICATOR_SHORTNAME, "OrderBook");
  IndicatorSetInteger(INDICATOR_DIGITS, Digits());

  MarketBookAdd(symbol);
}

int OnCalculate(
  const int bars,
  const int counted,
  const datetime& time[],
  const double& open[],
  const double& high[],
  const double& low[],
  const double& close[],
  const long& ticks[],
  const long& volume[],
  const int& spread[]
)
{
  if (iStart == 0)
  {
    iStart = 1;
    ZeroMemory(iDelta1);
    ZeroMemory(iDelta2);
  }
  else if (bars != counted)
  {
    iDelta1[0] = iDelta1[1];
    iDelta2[0] = iDelta2[1];
  }

  string symbol = Symbol();

  double ask = SymbolInfoDouble(symbol, SYMBOL_ASK);
  double bid = SymbolInfoDouble(symbol, SYMBOL_BID);

  MqlBookInfo levels[];

  bool book = MarketBookGet(symbol, levels);

  int indexBuy = 1;
  int indexSell = 1;
  long volumeBuy = 0;
  long volumeSell = 0;


  if (book)
  {
    int size = ArraySize(levels);

    for (int k = 0; k < size; k++)
    {
      if (levels[k].price >= ask) 
      {
        volumeSell += indexSell * levels[k].volume;
        indexSell++;
         
      }
    }

    for (int k = size - 1; k >= 0; k--)
    {
      if (levels[k].price <= bid) 
      {
        volumeBuy += indexBuy * levels[k].volume;
        indexBuy++;
     
      }
    }
  }

 iDelta1[0] = (double) ( - volumeSell);
 iDelta2[0] = (double) (volumeBuy); 
  return bars;
}
And with every new change in the stack, it overwrites the past amount. How do I make it accumulate the sum? In other words, it would not overwrite the data on the current bar, but add them? I tried to implement it using "while" loop and to add data while the current bar hasn't moved, but something went wrong. Please don't feel bad about such a trivial question.
 

FileOpen returns error 5001(Cannot open more than 64 files simultaneously).
I seem to close correctly each time via FileClose(file_handle).

Where and how is the open file count accumulated and how can it be reset?

Reason: