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

 
Ivaninoo Фащевский:
Hello. How do I catch the input signal from the illuminator indicator in the code? The indicator paints a candle on the chart and outputs an alert for entry. To make it simple, I want towrite a robot for this indicator.
iCustom()
 

Can someone suggest a simple trading Expert Advisor for an example that has all the necessary elements of an EA. I already have a certain decision algorithm for buying and for selling. I want to write and test it... I need an EA skeleton. Preferably with the following elements:

- MM control (incl. number of opened trades);

- MM control (if loss per day is more than X, trade stop for this day; if loss in this month is more than Y, trade stop until next month);

- close position by time (relative to the time of position opening);

I would like something simpler to start with...

 
Yevhenii Levchenko:

Can someone suggest a simple trading Expert Advisor for an example that has all the necessary elements of an EA. I already have a certain decision algorithm for buying and for selling. I want to write and test it... I need an EA skeleton. Preferably with the following elements:

- MM control (incl. number of opened trades);

- control of funds (if loss per day is more than X, trade stop for this day; if loss in this month is more than Y, trade stop till next month);

- Closing a position by time (relative to the opening time of the position);

I'd like something simpler to start with...

search KB for "pattern"... in my opinion, only lazy guy and I haven't written "dummies" for writing EAs )))

 
Igor Makanu:

search KB for "template"... in my opinion only the laziest person and I have not written "dummies" to write experts )))

Ok, thanks :)
 
Artyom Trishkin:
iCustom()
iCustom constantly returns the number 2147483647
 
Ivaninoo Фащевский:
iCustom returns the number 2147483647 all the time
This is an empty buffer value. Press Ctrl+D and see in which buffer, and when, the indicator has non-empty values. From there, dance around.
 
Question. I create OBJ_ARROW_BUY /OBJ_ARROW_SELL object, but all arrows always point to the right. I don't understand how to rotate them up/down as in the example https://docs.mql4.com/ru/constants/objectconstants/enum_object/obj_arrow_buy ?
 
The_Sheikh:
Question. I create OBJ_ARROW_BUY / OBJ_ARROW_SELL object, but all arrows always point to the right. I don't understand how to rotate them up/down as in the example https://docs.mql4.com/ru/constants/objectconstants/enum_object/obj_arrow_buy ?
It seems to be possible to set what type of arrow. Via:
SetIndexArrow(0,242);

Where: 0 - buffer index, 242 code from the table:

There are also examples here: https://www.mql5.com/ru/articles/1500

 
Igor Makanu:

In my opinion, "profile" saves the appearance of MT - the layout of panels, market overview windows, etc., but it does not remember the charts themselves, in general I have never used it properly, but it should work that way, imho

If I remember a template with a chart running on it and then close and open a chart and apply the template, the Expert Advisor will run with the settings that were used when writing the template.

If I'm right about the templates, then your problem should be solved by writing a script that opens the required charts and switches the TF to them and applies the saved template to each chart

SZZY: I think in KB once saw such an example, but I could be wrong, imho it's not convenient

The man asked a rather interesting question when the failure of all the settings are lost and how to configure everything back, but in fact there is no way to do it. I wonder how it is possible to simulate a failure that would lead to such consequences and what would be the consequences, what settings would be lost. Are there any such failures?

 
Roman Shiredchenko:

Hello! I would like to know if all the current (input) parameters manually entered in trading exposures are saved in a later saved "PROFILE", so I don't have to save all the robot's input parameters in separate *.set files, just save them all in the "profile". And if, in the event of a terminal failure, for example, you restore the previously saved profile, will all exponents with earlier saved settings be saved in it and set to trade again?

Have there been any failures such that the settings were lost, or has the robot itself flown off the chart due to a terminal failure?

Reason: