Is the linear deceleration a programming error or a feature of MT4? - page 6

 
sergeev:


You need to stop wasting time and finally start developing. Draw up the ToR.

As the client wants a solution, not a simple timeframe.

Already running).
 
FAQ:

It's been explained to you by an experienced person for the umpteenth time that in this code, in one pass of the start function

32 "for" cycles

17 times you scan the orders (both open and historical),

24 calls of the function of deleting pending orders, which also has a cycle for all orders (* number of orders)

7 calls of the function of deleting market orders with the same cycle for all the orders (*number of orders)

6 modifications of Limits with cycles inside (* number of orders)

6 modifications of stop orders with cycles inside (* number of orders)

10 order function calls with cycles inside (*number of orders)

37 times you print (Print),

7 (seven) times you access the full history of bars for the entire history (and it is growing during the testing).

And it takes a lot of time.

I'm not even talking about non-optimised "if" filters, complex conditions in them (and there is no abbreviated check in MT4).

And after that you can close your eyes to absolutely unreadable code, it is not important, at least you can put it through a styler and get something (although I personally don't like its style):

micle:
I may say it again, but! The first and probably the main problem is that the code is unreadable and unstructured. You may have quite a clear ToR. If you understand the ToR and write the code correctly, it (as a rule) gives a considerable profit in speed of execution but costs some other money too.

The bottom line is that you need a so-called flowchart, which will show you what is being executed unnecessarily. For beginner programmers (read "traders") it would be convenient to see such a code visualization by means of the MT4 program.

The simplest optimization, as I understand it, is to systematize the code for working with orders, namely to make only 2 main requests per bar and additionally per 1 tick, if the conditions of the ToR require working with orders when certain conditions occur, as a result we will receive

1. Checking conditions to modify/close an order when a new bar opens;

2. modify/close order

3. Check conditions for opening a new order when a new bar is opened

Open a new order; 4.

5. Checking conditions for bar upgrade on each tick

6. Modernizing/Closing an order when condition 5 is met.

But one programmer told me that the code will be executed at every tick anyway (full conformity check of the order, and not only that part, which should be checked at every tick), can't it be solved somehow?

Does the function "print" slow down the Expert Advisor during optimization?

What file did you attach after you ran it in the "styler"?

 
which you posted in the first post of the thread.
 

FAQ:
который вы выложили в первом посте темы. 

And as for "the code will still be executed on every tick (full check against the TOR, not just the part that should be checked on every tick)", can you comment on that?

 
-Aleks-:

And as for "the code will still be executed on every tick (full compliance check with TOR, not just the part that should be checked on every tick)", how do you comment?

You have to re-do it, re-do it wisely. Then everything will work when and how it should.
 
FAQ:
You have to redo it, you have to redo it wisely. Then everything will work when and how it should.

I'm not talking about this code, but globally. So you refute this statement?

 
-Aleks-:

I'm not talking about this code, but globally. So you refute this statement?

Don't engage in theory. You won't understand anything anyway.

All theory without a specific code or application is mere nonsense.

If you want to disprove or prove it, do the code and see how it behaves.

 
sergeev:

don't engage in theory. you won't understand anything anyway.

All theory without a specific code or application is mere chatter.

If you want to disprove or prove it, do the code and see how it behaves.

There's probably a lot I don't understand, but I'm trying to understand it...

Thinking about your call to action...

 
-Aleks-:

But trying to understand it...

Until you open MetaEditor and start writing your own code, you'll never understand how it works.
And even a small beginner proger will overwhelm all your theoretical knowledge with his practical skills and empirical observations.
If you don't plan to "write your own code" - then don't even begin to ask this forum why something is lagging, because it makes no sense to you.

Or have you decided to become a pro coder on the advice from the forum? :)))) The name of the theme "linear deceleration" tells us that you have studied at some science department or an engineer.


There are no theoreticians in programming, just as there are no pro footballers/coaches/surgeons/linguists who are theoreticians and have never been in practice.

All your efforts to find out the reasons why the program does not work should not lie in the plane of "I want to know", but in the concrete vector of "must do".

All the other theoretical reasoning with high-sounding notions is not worth a penny without concrete actions.


And a bit of humour to the point.






 
sergeev:

Until you open MetaEditor and start writing your own code, you will never understand how it works.
And even a small beginner proger will overwhelm all your theoretical knowledge with his practical skills and empirical observations.
If you don't plan to "write your own code" then don't even begin to ask the forum why something is lagging, because it makes no sense for you.

Or have you decided to become a coding pro on the advice from the forum? :))) The name of the topic "linear braking" tells us that you studied at some science or engineering school.

There are no theoreticians in programming, just as there are no pro footballers/coaches/surgeons/linguists who are theoreticians and have never been in practice.

All your efforts to find out the causes of failure of the program must lie not in the plane of "I want to know", but in a particular vector of "must do".

All the other theoretical reasoning with pompous notions is not worth a penny without concrete actions.

And a bit of humorous substance to the subject.

Thanks for the humour!

But on the subject, my professional work lies in the field of tax optimization, so I'm familiar with algorithms ;) Believed that my TOR are understandable, of course after specifying the details (I try and draw pictures and calculations in excel).

Moreover, I am familiar with MetaEditor, and I am able to make a simple indicator or correct the logic of Expert Advisor. But I have a big problem with trading functions... I'm just now limited in time, and I don't feel myself a born programmer, but I need to understand the basics and features of MQL language, in order to defend my interests in completing my order.

And then I am really curious.

Документация по MQL5: Торговые функции
Документация по MQL5: Торговые функции
  • www.mql5.com
Торговые функции - Документация по MQL5
Reason: