(whether it increases or decreases) through repeated generation of the condition in , e.g.
LongCondition();
The already opened position remains unchanged, it can only be deleted upon triggering of sl , tp.
I like MQL5 Wizard, it's quick and easy to 'build' a multi-indicator EA, change the sl tracking module, change the money management module.
But my attempt to write an EA that opens a minimum position when a trend is confirmed by one indicator and increases (increases) the position when the trend is confirmed by another indicator
came across the previously described problem - an already open position does not change when re-issuing a signal to open through e.g.LongCondition();
Вы не знаете, как устроены торговые классы, и пугаетесь слов "Объектно-ориентированное программирование"? На самом деле вовсе не обязательно всё это знать, чтобы написать свой собственный модуль торговых сигналов - достаточно следовать простым правилам. Всё остальное сделает Мастер MQL5, и вы получите готовый торговый робот!
But as soon as I run it in the tester, it loads the history for the following instrument; it cannot be loaded. How can I disable it for the tester????????
2013.04.04 14:09:21 Core 1 GBOTEURUSD17DEC2012: history synchronization started
Hello, could you please tell me why I can't log in to the terminal. I enter the server, account number and password, but the following entry appears in the log: 2013.04.05 12:51:20 Network'68712': connection to 208.64.66.68:443 lost
I tried another server, same thing, what am I doing wrong?
Unfortunately, the case you describe falls into the category of what is referred to here (in the Forum) as 'fine-tuning'.
To solve the problem, you need to change the behaviour of the expert. To do this:
1. You must create a new class (for example CMyExpert) which inherits from CExpert class.
2. Reload Processing method in it, changing its behavior.
3. Replace (manually) include file in the Expert Advisor source code.
to
4. Replace (manually) the class name in the Expert Advisor source code.
to
An example class is attached. Exit from method if there is an open position and there are no operations on it is commented out (line 53).
Remember to follow steps 3 and 4 after each "regeneration" of the Expert Advisor in the Wizard.
PS If you have any questions, feel free to contact me.
Thank you very much, everything works! It adds the same volume when the trend is confirmed by another indicator.
Now we have one more question - is it possible to change the size of the "add"? For example, the standard position size in the money management module is 0.1, while I want to add ("add") 0.3 or 0.35, etc. calculated by the Expert Advisor.
How can I pass the "refill" size from theLongCondition() subroutine to the trade module?
Thank you so much, it's working! Adds the same volume on trend confirmation from another indicator.
Now I have one more question - is it possible to change the size of the "share"? For example, the standard position size in the money management module is 0.1, while I want to add ("add") 0.3 or 0.35, etc. calculated by the Expert Advisor.
How can I pass the "refill" size from theLongCondition() subroutine to the trade module?
//+------------------------------------------------------------------+//| Long position open or limit/stop order set |//+------------------------------------------------------------------+bool CExpert::OpenLong(double price,double sl,double tp)
{
if(price==EMPTY_VALUE) return(false);
//--- get lot for opendouble lot=LotOpenLong(price,sl);
//--- check lot for openif(lot==0.0) return(false);
//---return(m_trade.Buy(lot,price,sl,tp));
}
//+------------------------------------------------------------------+//| Short position open or limit/stop order set |//+------------------------------------------------------------------+bool CExpert::OpenShort(double price,double sl,double tp)
{
if(price==EMPTY_VALUE) return(false);
//--- get lot for opendouble lot=LotOpenShort(price,sl);
//--- check lot for openif(lot==0.0) return(false);
//---return(m_trade.Sell(lot,price,sl,tp));
}
Overload in your class (similar to Processing) and change the lot determination algorithm.
felidae:
Нет, всё в порядке, просто я дал случайно свою ссылку. Ваша должна быть по идее такая: https://www.mql5.com/ru/users/vik1991/accounting/chooseout
Thanks for the reply, is there any way to increase the earnings or just wait for the demand to increase?
Please advise how to increase (refill) a position in an EA based on the MQL5 Wizard, where positions are opened using
virtual int LongCondition();
virtual int ShortCondition();
I wrote a robot based on the following article
https://www.mql5.com/ru/articles/367"Create a trading robot in 6 steps" and it works fine, but any attempt to influence the position size
(whether it increases or decreases) through repeated generation of the condition in , e.g.
LongCondition();
The already opened position remains unchanged, it can only be deleted upon triggering of sl , tp.
I like MQL5 Wizard, it's quick and easy to 'build' a multi-indicator EA, change the sl tracking module, change the money management module.
But my attempt to write an EA that opens a minimum position when a trend is confirmed by one indicator and increases (increases) the position when the trend is confirmed by another indicator
came across the previously described problem - an already open position does not change when re-issuing a signal to open through e.g.LongCondition();
I want to leave only forex tools in the market, the code works fine
But as soon as I run it in the tester, it loads the history for the following instrument; it cannot be loaded. How can I disable it for the tester????????
2013.04.04 14:09:21 Core 1 GBOTEURUSD17DEC2012: history synchronization started
Please advise how to increase (refill) a position in an Expert Advisor that is based on the MQL5 Wizard and where positions are opened via
Unfortunately, the case you describe falls into the category of "improvement" here (in the Forum).
To solve the problem, you need to change the behavior of the Expert Advisor. To do this:
1. We need to create a new class (for example CMyExpert) which inherits from CExpert class.
2. Reload Processing method in it, changing its behavior.
3. Replace (manually) include file in the Expert Advisor source code.
#include <Expert\Expert.mqh>to
#include <Expert\MyExpert.mqh>4. Replace (manually) the class name in the Expert Advisor source code.
to
The example of class is attached. The exit from method if there is an open position and there are no operations on it is commented (line 53).
Don't forget to follow items 3 and 4 after each "regeneration" of the Expert Advisor in the Wizard.
PS If you have any questions, please contact me.
Unfortunately, the case you describe falls into the category of what is referred to here (in the Forum) as 'fine-tuning'.
To solve the problem, you need to change the behaviour of the expert. To do this:
1. You must create a new class (for example CMyExpert) which inherits from CExpert class.
2. Reload Processing method in it, changing its behavior.
3. Replace (manually) include file in the Expert Advisor source code.
to
4. Replace (manually) the class name in the Expert Advisor source code.
to
An example class is attached. Exit from method if there is an open position and there are no operations on it is commented out (line 53).
Remember to follow steps 3 and 4 after each "regeneration" of the Expert Advisor in the Wizard.
PS If you have any questions, feel free to contact me.
Thank you very much, everything works! It adds the same volume when the trend is confirmed by another indicator.
Now we have one more question - is it possible to change the size of the "add"? For example, the standard position size in the money management module is 0.1, while I want to add ("add") 0.3 or 0.35, etc. calculated by the Expert Advisor.
How can I pass the "refill" size from theLongCondition() subroutine to the trade module?
Thank you so much, it's working! Adds the same volume on trend confirmation from another indicator.
Now I have one more question - is it possible to change the size of the "share"? For example, the standard position size in the money management module is 0.1, while I want to add ("add") 0.3 or 0.35, etc. calculated by the Expert Advisor.
How can I pass the "refill" size from theLongCondition() subroutine to the trade module?
The CExpert class has methods:
Overload in your class (similar to Processing) and change the lot determination algorithm.
The CExpert class has methods:
Overload in your class (similar to Processing) and change the lot detection algorithm.
There is an indicator that says it works on the opening price
code