I need a simple script. Can anyone really write it without reasoning and demagogy? I'm willing to pay. - page 8

 
It's easy to become a god...
 
granit77 писал(а) >>
It's easy to become a god...

>> it's a commercial break,

an uncomfortable position for a god to be in,
>> ....
straight down to where we so eagerly looked up to the heavenly heights... NP (c)

 

The scripts work great! I have one more request: when the script closes one trade, the second should be trawled. The attached trall is fine, but there are some not fine. Please, is it possible to tweak the trall? If yes, I would like: 1) trawl not only closes 1/3 lots, but also can close 1/2 lot; 2) trawl would work with micro lots - 0.02, 0.03 and 0.04 respectively; 3) and respectively, if it closes 1/2 and 1/3, then with lots 0.2, 0.3, 0.4, 0.6, 0.8, 0.9, 2.0, 3.0, 4.0, 6.0, 8.0


And there is also a problem, for example Alpari, has changed the list of lots by default. The terminal used to have a list of lots 0.1, 0.2, 0.3 etc., but now 0.11, 0.12, 0.13, 0.14 and immediately 1.0 etc. Trall does not want to close lot 0.3 in automatic mode 1/3 ( 0.1 lot) and leave 0.2 lot for further tralling. Maybe something can be solved in this issue as well?

Files:
 
MarketInfo returns lot increments, lot minimum and maximum,
however, there is no way to programmatically find out the gaps in the allowed sizes.
- nothing other than to set all lot sizes manually, e.g. in the parameters.
 
Korey >> :
MarketInfo returns lot increments, lot minimum and maximum,
but there is no way to programmatically find out the gaps in the allowed sizes.
- nothing other than to set all lot sizes manually, e.g. in the parameters.

Honestly, I don't understand anything. And where do you set the lot sizes? In parameters of what? Well, in Fibo terminal, everything is OK, but there are default lots 0.1, 0.2, 0.3 etc. And so lot 0.3 clearly closes at 0.1, i.e. it closes 1/3 and leaves lot 0.2 to further accompany the trade.

 
Monah писал(а) >>

The scripts work great! I have one more request: when the script closes one trade, the second should be trawled. The attached trall is fine, but there are some not fine. Please, is it possible to tweak the trall? If yes, I would like: 1) trawl not only closes 1/3 lots, but also can close 1/2 lot; 2) trawl should work with micro lots - 0.02, 0.03 and 0.04 respectively; 3) and respectively, if it closes 1/2 and 1/3, then with lots 0.2, 0.3, 0.4, 0.6, 0.8, 0.9, 2.0, 3.0, 4.0, 6.0, 8.0

And there is also a problem, for example Alpari, has changed the list of lots by default. The terminal used to have a list of lots 0.1, 0.2, 0.3 etc., but now 0.11, 0.12, 0.13, 0.14 and immediately 1.0 etc. Trall does not want to close lot 0.3 in automatic mode 1/3 ( 0.1 lot) and leave 0.2 lot for further tralling. Maybe something can be solved in this issue too?

Fixed it... You can set the number of parts to close by yourself... Value parameter...

not checked... should work...

Files:
 
Thank you very much! I'll be testing. Probably won't make it to the end of Friday. I'll report the results on Monday.
 
kharko , yes, it works, but somehow strange. On micro it closes only at Value=3 one third at lot 0.03 (as it should), but at Value=2 and lot 0.04, it closes nothing. On Alpari, it's the opposite. At Value=2, it closes half at lot 0.2 (as it should), at Value=3 and lot 0.3, it closes nothing. Stops move as it should, everywhere. However, all the same, thank you very much for your attention! Thanks to your updates, I can still use this EA effectively.
 

New article Programming EA's Modes Using Object-Oriented Programming has been published at mql5.com:

In this article we are going to discuss programming modes, in which an MQL5 EA can work. The objective of this article is to describe the idea that "each mode is implemented in its own way". The author believes that this approach allows completion of tasks at different stages of development of an EA more efficiently.

At first, we consider what stages the development of an EA consists of. Then the modes, in which an EA in MetaTrader 5 can work and its helper applications are explored. Development of the hierarchy of classes for implementing the above idea finishes this article.


1. Development Stages

Development of a trading robot (EA) is a multi-aspect process. The key blocks here are algorithmization of the idea and testing it. Notably, both EA's trading logic and the code algorithm get tested.

As a scheme, the stages of this process can be represented as follows (Fig. 1).

Fig.1. Development stages and implementation of an EA

Fig.1. Development stages and implementation of an EA

Author: Dennis Kirichenko

Reason: