Questions on MQL5 Wizard and standard library of trading classes

 

Recently decided to understand the standard classes and the wizard a bit. As I study it, I get questions, which I can't find answers to in the help.

I am writing my own module of position management after preliminary reading the article

The CheckTrailingStopLong(CPositionInfo* position,double& sl,double& tp) method gets reference to CPositionInfoobject . Right away we have some questions about the CPositionInfo class:

1) if position on one symbol is formed by different EAs (different magiks) or hands. e.g. orders:

sat 2 lots (medg1)

take 4 lots (by hands)

buy 2 lots (medg1)

take 1 lot (by hands)

aggregate position will be: Aggregate 5 lots

what is position.Volume ? 5 lot sat?

2) Question about the Identifier property, I assume this is a unique position ID:

- if the volume of the position changes in the course of the trade or there is a reversal, the Identifier changes?

- If a position is closed and then a new one is opened, will the Identifier change?

- If I select the history of orders and deals in the CheckTrailingStopLong method:

long position_ID = position.Identifier();
HistorySelectByPosition(position_ID);

will the selection include the orders with other slips that differ from this EA?

I would be grateful for answers.

That's all for now, but I will ask more questions as I learn :)





 

t-34:


1) Yes, lot 5 sell

2)

- The Identifier does not change when the volume changes and the position reverses. That's what it's for.

- The new position will also have a new Identifier. It is equal to the order which opened the position.

- All the orders which were forming this position will be filled in.




 

There are questions about Stops in generated EAs.

1. Expert Advisors have initial Stops and Trailing Stops, but in the input parameters of the generated EA these Stops look the same;

2. There are initial Profits, but there are Trailing Profits. But profits don't move like stops, then what's their point.

Here is a quote from the documentation:

 

If the Stop Loss modification condition is met and the Take Profit level is not zero, then a new Take Profit price for the position is suggested.

3. How do I get the cursor to move out of the frame (this is how many times I've suffered!)

Мастер MQL5: Создание эксперта без программирования
Мастер MQL5: Создание эксперта без программирования
  • 2010.12.15
  • MetaQuotes Software Corp.
  • www.mql5.com
Вы хотите быстро проверить торговую идею, не тратя времени на программирование? Выберите в "Мастере MQL5" нужный тип торговых сигналов, подключите модули сопровождения позиций и управления капиталом - на этом вся работа закончена. Создайте свои реализации модулей или закажите их через сервис "Работа" - и комбинируйте новые модули с уже существующими.
 
Erm955:
3. How to make the cursor go out of the frame (how many times I suffer!)

Change the vertical scale of the chart (left-click and drag on the price line field) and the levels you require will be available.


Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Свойства объектов - Документация по MQL5
 
Urain:

Change the vertical scale of the chart (left-click and drag on the price line field) and the levels you want are available.


Thank you, of course, but I'm talking about the frame above. Now the cursor came out by itself, and sometimes there is no way to get it out.
 
Erm955:
Thank you, of course, but I'm talking about that frame at the top. Now the cursor has come out on its own, and sometimes there's no way to get it out.
Press Enter inside the frame after the last paragraph, then press theDown Arrow key all the way down.
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
Документация по MQL5: Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов
  • www.mql5.com
Стандартные константы, перечисления и структуры / Константы объектов / Типы объектов - Документация по MQL5
 

Well, on these questions how:

Are there still trailing profits or did I misunderstand something about the generated EAs!?

149

Erm9552011.06.20 09:162011.06.20 09:16:07

I have questions about Stops in generated EAs.

1. The Expert Advisor has initial Stops and Trailing Stops, but in the input parameters of the generated EA, these Stops look the same;

2. There are initial Profits, but there are Trailing Profits. But profits don't move like stops, then what's their point.

Here is a quote from the documentation:

If the Stop Loss modification condition is met and the Take Profit level is not zero, then a new Take Profit price for the position is suggested.

 
Erm955:

Well, on these questions how:

Are there still trailing profits or did I misunderstand something about the generated EAs!?

149

Erm9552011.06.20 09:162011.06.20 09:16:07

I have questions about Stops in generated EAs.

1. The Expert Advisor has initial Stops and Trailing Stops, but in the input parameters of the generated EA, these Stops look the same;

2. There are initial Profits, but there are Trailing Profits. But profits don't move like stops, then what's their point.

Here is a quote from the documentation:

You got it right. The point of trailing profits (as I see it) is that under certain conditions, the trend ends with a powerful roll, followed by an equally powerful bounce.
 
uncleVic:
You got it right. The point of a trailing profit (as I see it) is that, under certain conditions, the trend ends with a powerful roll, followed by an equally powerful bounce.

OK! Got it. That is, I can exit on profit at strong market moves in the right direction, when the profit does not have time to move synchronously with the price.

But you still have to call them differently in the input parameters:

1) initial Stops/Profits

2) Trailing Stops/Profits.

Files:
dzo7h2.PNG  15 kb
 
Erm955:

OK! Got it. That is, I can exit on profit at strong market moves in the right direction, when the profit does not have time to move synchronously with the price.

But you still have to call them differently in the input parameters:

1) initial Stops/Profits

2) Trailing Stops/Profits.

Ok, we'll correct it.
 

Please check EAs generated with weekly indicators, in particular with Accelereator. It does not work! This has been noted by me since the previous build (468).

Reason: