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

 
Creativ:
This function doesn't bind a bar to time. I need Bar[0]=:00(minutes) or 01:00, 02:00 ...of each day. Thus, only when a certain time comes, the algorithm will be calculated. The rest of the time the indicator rests with me.

To do this you need to create an array to return the time with that function and build the structure you need, I gave you a little hint, but no one will give you a complete solution on the forum because this is an extensive amount of work. First check that function, figure out how it returns time and then create arrays where one timeframe is based on the calculations of the other.

 
Seric29:

To do this you need to create an array to return the time with that function and build the structure you need, I gave you a little hint, but no one will give you a complete solution on the forum because this is an extensive amount of work. You should first check that function, figure out how it returns time and then create arrays where one timeframe is based on the calculations of the other.

Ban the victim of mad intelligence already :-)

Porfiryich is smarter than that:

 
I really need your help. How to make sure that after a triggered stop loss - do not open the same order to a new signal?
 
jarikn:
I really need your help. How to make sure that after a triggered stop loss - do not open the same order to a new signal?
not enough information (raw data) more details...
 

COLLEAGUES! Need a "marker" of the start of a NEW series (may consist of one) of market orders, after thinking about it, the first thing that came to mind was to compare the opening time of the first open in the cycle by open from the beginning of the register of open market positions. If it changes upwards, then the series (can also consist of a single open) has changed.

Is this also possible?

Or are there still more elegant options...

 
Roman Shiredchenko:

COLLEAGUES! Need a "marker" of the start of a NEW series (may consist of one) of market orders, after thinking about it, the first thing that came to mind was to compare the opening time of the first open in the cycle by open from the beginning of the register of open market positions. If it changes upwards, then the series (can also consist of a single open) has changed.

In the same way, it is possible to?

Or there are even more elegant options...

just before the opening, check how many market orders fall under the required filter (have the required Magic, type OP_BUY|OP_SELL, and optionally a symbol). If there are 0 then a new series has been started. When you open a series, specify the series number in Magic or in comments or in your personal database.

If we don't do that, the algorithm "Is the order the start of a new series" for an arbitrary order in the history or market is much more complicated - the order opening time should not fall into the range OrderOpenTime..OrderCloseTime of historical orders and should be less than all market orders.

 
Maxim Kuznetsov:

Just before the opening, check how many market orders fall under the required filter (have the required Magic, type OP_BUY|OP_SELL and optionally a symbol). If there are 0 then a new series has started. When you open a series, specify the series number in Magic or in comments or in your personal database.

If we don't do that, the algorithm "Is the order the start of a new series" for an arbitrary order in the history or market is much more complicated - the order open time should not fall into the range OrderOpenTime..OrderCloseTime of historical orders and should be less than all market orders.

Thank you! I was thinking about "0" in the context that, for example, if a series is closed and there is a trade signal to open a new one, then in fact "0" might not be caught in time, i.e. a new order which has turned into a market position will open... before "0" is "caught" in the cycle of open positions...

So I will try it out in practice, if it doesn't catch the start of the series - I'll ask here.

 
First, the forum thread is for questions from newbies to those who understand something. Whoever created it must have had that goal in mind. And the fact that I can't get an answer to a simple question indicates that the forum is useless because everyone is sitting and waiting to get paid. Secondly, mql4 language developers need to tear off their hands (or brains), because they have to start a vegetable garden to solve a simple question. A graphical object has not three variables, but a bit more. And the main variables are price and time, if you remember the parabola.
Seric29:

To do this you need to create an array to return the time with that function and build the structure you need, I gave you a little hint, but no one will give you a complete solution on the forum because this is an extensive amount of work. First check that function, figure out how it returns time and then create arrays where one timeframe is based on the calculations of the other.

 
Creativ:
First, the forum thread is for questions from newbies to those who understand something. Whoever created it must have had that goal in mind. And the fact that I can not get an answer to a simple question, indicates that the forum is useless because everyone is sitting and waiting to get paid. Secondly, mql4 language developers need to tear off their hands (or brains), because they have to start a vegetable garden to solve a simple question. A graphical object has not three variables, but a bit more. And the main variables are price and time, if you remember the parabola.

Fine. The platform developers need to get their hands, brains, maybe something else, and those who can't write anything in response to a completely incomprehensible wish:

Forum on trading, automated trading systems and testing trading strategies

Any questions from newbies on MQL4 and MQL5, help and discussion on algorithms and codes

Creativ, 2020.02.09:51

I'm not a programmer, so I can't solve the simplest question: how to bind zero bar to time, minutes :00, hours 00:,01:,02: etc. Maybe someone can tell me?

What do you want to trade?

Or maybe you should write clearly what is needed? Or go straight to solving the problem of extra body parts in the questioner?

 
I have such a problem.
I need to open an order when the price Ask crosses e.g. a moving MA. i.e. Ask==MA. is it possible to do that? Or if the price is higher than MA by 3 points for example. Please advise