Need help - page 4

 
a007 #:

I have three simple questions: the future of humanity depends on the answers:

1. where did the EA idea come from (who suggested it, where did I read it, ...) ?

2. What are the signs (how do I know it works, how do I understand it) it only works on one window, and it won't open on the second?

3. Why throw in another window, why is one window not enough?

1. during the test period I can only say one thing so far, I found the tip on the network, for a long time went in this direction, but felt that something was missing), and then finally saw one interesting thing on the network, which gave all the answers I need), I think many about the essence of the idea know, and perhaps someone is already cabbage cutting using this algorithm ... I don't know ), it's on the surface, but I haven't seen anything similar in open sources for many years, so I have to test it on my knees ... I use Excel, I screwed the quotes in it, I stuffed it with formulas and calculations, and I still do it like that, I have not fixed my status for reporting for 4 days, I fixed the table but profits without re-investing for 5 days averaged 30% a day, not a martin, without optimization, without indicators, I don't care what broker, the drawdowns were not observed, reversals are slow, which makes it easy to open in the right direction, today profits are also within 30%. If you help me to complete the owl for the test, I will post the reports from MT4 for the test period.
2. Yes the signs are simple, first you put the owl on one window, everything works, then you put it on the second window, in the window appears, but nothing happens, the orders do not open.
3. For now I have to use the following way: a signal for entry, select the required pair list in the Input parameters, indicate the direction and open it in the chart window, according to the rules there will be, for example, 6 signals and for each signal a different list of openings, in this case the second and the third owl should be thrown... into different windows to open consecutively 6 orders of different scopes from the list.
In order to open everything in one window, we should add all the mathematics of the algorithm that would give signals for sequential opening of 6 orders, but that is a separate topic for individual programmer's work.
At this stage I see the solution as follows, if you suggest something better, I do not mind, in the case of a positive result of testing (preferably in MT) it will already make sense and interest in creating a full-fledged automated machine, while everything is going much better, and we will see.

 
Sergey Korsunov #:

All done, works great, thanks
but when compiling it gives out some warnings, what does it mean? And how do I remove them?

OrderSend in MQL4

Returns the ticket number assigned to the order by the trade server or -1 in case of failure. To get the information about the error, you need to call the GetLastError() function.


But the returned value flies to nothing. It is not crucial, of course, but it is not the best programming style.

F1 will help you, there is also a small example

 
At the moment I have achieved the required result with my code, which I have changed with your help, and many thanks for that.
The Expert Advisor has started to open the required symbol list in new windows.
tomorrow I will have to correct the whole code, and it is not a small one, and it is kind of messy), but it seems to work), I have no experience and knowledge.
 
Sergey Korsunov #:
At the moment I got the result I need with my own code, which I have changed with your help, and thank you very much.
The Expert Advisor has started to open the required symbol list in new windows.
tomorrow I will have to correct the whole code, and it is not a small one, and it is kind of messy), but it works), I do not have enough experience and knowledge.

You need to learn how to write short code straight away. Compare your version with mine.

Throw out unnecessary functions and brackets, and arrange repetitive parts with functions.

Half of the program text should be commented on 3 levels:

1. The whole program is clear, complete and without redundancy.

2. To particular parts of the program: Functions, loops, ...

3. To individual operators.

 
a007 #:

You need to learn how to write short code straight away. Compare your version with mine.

Throw out unnecessary functions and brackets, and arrange repetitive parts with functions.

Half of the program text should be commented on 3 levels:

1. The whole program is clear, complete and without redundancy.

2. To particular parts of the program: Functions, loops, ...

3. To individual operators.

I am just at the very beginning, just starting )
My original version had over 8 000 lines O_o ))
After yesterday's corrections the code was reduced exactly 2 times, but it is also very, very much compared to yours.
Yesterday it took me a whole day to rewrite it.
If you help me to finish what I have started I will be very grateful to you.

The bot has worked well with this strategy today.
My main job is just to open orders in the right order and it has done it well.
The only thing I screwed up today is not paying attention to the size of the default lot, all on the opening with a lot of 0.01, and had to lot 1.0 to set, just inattention, it could certainly restart 1 lot, but that too lazy).

The result of trading today strategiki (at 1 lot) +50%!
While I was writing this post I got over 65% PROFIT in Excel)

Files:
Screenshot_7.jpg  421 kb
 
a007 #:

............ make repetitive parts into functions.


this is exactly what is missing in the code, but i don't know how to do it
all my code consists of repetitions

 
Sergey Korsunov #:
the EA has started to open the required list of instruments in new windows.

What do you call new windows? In Windows there is a different programme running in each window! Do you run many terminals? Why do you need new windows?

The EA has to work on one chart. It has to send orders to the server. In which windows does it open the list?

 
a007 #:

What do you call new windows? In Windows there is a different programme running in each window! Have you run many terminals? Why do you need new windows?

The EA has to work on one chart. It has to send orders to the server. In which windows does it open the list?

I will try to describe it at
. At this stage, the bot is needed only for the opening of orders according to certain rules during the strategy testing.
We have only one terminal.
The new windows are needed solely for the opening of new orders in a cyclic sequence.
It looks as follows:
I launch the bot in the first window, it opens 6 orders with different symbols considering the list.
I open the next list of 6 orders in the second window, but with slightly different settings in the Input Parameters window and so on.
After all orders in the windows have been opened, I delete all bots so that after a profit is fixed by an additional bot which closes all positions, the bot does not open them again.
For now 6 windows are enough, of course, I can work in one window and delete the bot every time when new orders are opened, but it is too much trouble.)
If you are interested, I can show you the working part of the code.
When opening new orders, you have to set 2 parameters in the settings, the 3rd one if necessary (direction of deal is buy or sell).
At the moment the bot does its job, sometimes it slows down a little when opening orders, but I think it is just because of too long code).
The variant with a text file with a list of instruments would simplify the code incommensurably and significantly speed up its work.


 
Sergey Korsunov #:

There is only one terminal.
New windows are only needed to open new orders in a cyclic sequence.
It looks like this: I start the bot in the first window, ...

I got it. You are confusing windows and charts. Terminal is a Windows application. Each application works in its own window. Since the terminal is the same, the window is the same.

You start the robot in different windows, then wait, then close it... You waste a lot of time on this.

The robot must be one and do all the work at once. Then on the real 100 dollars and 2 weeks of testing.

If it will lose, good riddance. If it fills - replenish the deposit.

 
Sergey Korsunov #:

I will try to describe
At this stage, the bot is needed only for opening orders according to certain rules during strategy testing.
There is only one terminal.
New windows are needed solely for the opening of new orders in a cyclic sequence.
It looks as follows:
I launch the bot in the first window, it opens 6 orders with different symbols considering the list.
I open the next list of 6 orders in the second window, but with slightly different settings in the Input Parameters window and so on.
After all orders in the windows have been opened, I delete all bots so that after a profit is fixed by an additional bot which closes all positions, the bot does not open them again.
For now 6 windows are enough, of course, I can work in one window and delete the bot every time when new orders are opened, but it is too much trouble.)
If you are interested, I can show you the working part of the code.
When opening new orders, you have to set 2 parameters in the settings, the 3rd one if necessary (direction of deal is buy or sell).
At the moment the bot does its job, sometimes it slows down a little when opening orders, but I think it is just because of too long code).
The option of a text file with a list of symbols would simplify the code and significantly speed up its work.


Does the second list and settings depend on the first set of orders, or all of the lists and settings are known in advance? I would like to have a look at the working part. You write that the settings have to be changed for the second list/set of orders, but you don't specify what they depend on.

Reason: