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

 
Tretyakov Rostyslav #:

A lot of unnecessary "water"...

First write a "simple EA" that just puts out an order, then ask for help to refine it.

As it is, your text looks like "write me"!

Just placing an order, placing an order according to a certain scheme is by no means a refinement. I don't know how to keep track of the orders placed and closed. Price changes, it's not necessarily the case that with the opening of a new day the price won't jump a few orders. And there are a lot of other nuances. The table of deals does not allow to compare the number of securities bought and sold at the same price.
 

Good day

Here is a simple code which sets a vertical line showing the beginning of trade for visualization

ObjectCreate(0,"Начало торговли",OBJ_VLINE, 0, Time[0] + (StartTime*3600), 0);
ObjectSetInteger(0,"Начало торговли",OBJPROP_COLOR, clrBlue);
extern int                  StartTime                      = 2;         // Начало торговли

I can not understand why the vertical line is set according to - (StartTime - the value of one bar)


 
Кирилл Якимов #:
I don't know how to keep track of the entries and closures.

Well that's a long explanation https://www.mql5.com/ru/docs/trading

Документация по MQL5: Торговые функции
Документация по MQL5: Торговые функции
  • www.mql5.com
Торговые функции - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
EVGENII SHELIPOV #:

Good day

Here is a simple code which sets a vertical line showing the beginning of trade for visualization

I can not understand why the vertical line is set according to - (StartTime - the value of one bar)


Try this and show a screenshot of the result
extern int nBars = 10;

...
ObjectCreate(0,"Начало торговли",OBJ_VLINE, 0, Time[0] + PeriodSeconds(PERIOD_CURRENT) * nBars, 0);
 
Кирилл Якимов #:
Just placing an order, placing orders according to a certain scheme is not at all an accomplishment. I don't know how to keep track of the orders placed and closed. The price changes, it doesn't necessarily mean that with the opening of a new day the price won't jump several orders. And there are a lot of other nuances. The table of deals does not allow to compare the number of securities bought and sold at the same price.

In order to place orders according to a certain scheme, you basically have to know how to place orders. And then you form a condition for placing orders.

You have to solve the problem step by step and there are a lot of nuances with it.

 
Mihail Matkovskij #:

Well, that takes a long time to explain https://www.mql5.com/ru/docs/trading

If you want to learn how to write robots, start with a simple one:

Mihail Matkovskij #:

Simple Expert:https://www.mql5.com/ru/code/103

More results

 
Mihail Matkovskij #:
Try this and show in the screenshot what you got

Here's what came out

 
EVGENII SHELIPOV #:

Here's what came out

What do you need anyway?
 
EVGENII SHELIPOV #:

Here's what I got.

What's wrong with your code?

Here's what I got with this script

Files:
 

Good afternoon!

Continuing all sorts of experiments.

This idea has occurred to me. Is it possible to make one chart out of several ones? For example, there are three indices - Japanese, Australian and New-Zealand's. I would like to make a composite chart-drawing ofAsian session prices. And it should be somehow calculated not point by point (because it will not be universal), but by each issuer's price deviation, and then a broken line of prices is formed and it all somehow sums up (their deviations).

Why this is needed: summary charts are very helpful in understanding this or that process, sector, industry, etc.