Discussion of article "MQL5 Wizard: How to Create a Module of Trading Signals" - page 4

 

Can you tell me how I can use LongCondition and ShortCondition to not only open but also close a position without opening the opposite position? For example, Signal threshold value to open = 30 and Signal threshold value to close = 70.

We want to open long when Condition1 is executed and close the position when Condition2 is executed. What values should LongCondition and ShortCondition return in this case?

If controlling the return values of LongCondition and ShortCondition is not enough, how can it be done? It is assumed that we are using only one signal.

Thanks.

 

Hi,

i followed all steps in the article, but i got it not work.

I saved the signal in the files \include\expert\signal\mysignals\samplesignal.mqh.

But it isn't recognized by the meta editor. I tried the same with the attached file in the article, no change...


My current Meta Editor version is 5.00 Build 567


Any ideas?


Thanks Mario

 

when  I use the file that you attached to the article,there is something wrong. 

I find the comment about Type should be as follows:

//| Type=SignalAdvanced                                          |

 
yankai0219:

when  I use the file that you attached to the article,there is something wrong. 

I find the comment about Type should be as follows:

//| Type=SignalAdvanced                                          |

 

You can read that in the article Create Your Own Trading Robot in 6 Steps!
 

Hi All,

I downloaded the signal from this article and created a MQ5 using the wizard, but the EA does not make any trades. Any ideas?

I had to make the change in the above comments to get the signal to show up in the list, apart from that it compiled OK. Running the EA in the strategy tester does not do anything though :( 

 

EDIT: After inserting print statements in all CSampleSignal class functions, and CExpertSignal class functions, it appears as if the inherited functions are not being overwritten by the CSampleSignal functions-

i.e. in this example, instead of these executing: 

class CSampleSignal : public CExpertSignal
  {
	bool CSampleSignal::CheckOpenLong(double& price,double& sl,double& tp,datetime& expiration);
	bool CSampleSignal::CheckOpenShort(double& price,double& sl,double& tp,datetime& expiration);

 

The following are executed:

class CExpertSignal : public CExpertBase
  {
	virtual bool     CheckOpenLong(double& price,double& sl,double& tp,datetime& expiration);
	virtual bool     CheckOpenShort(double& price,double& sl,double& tp,datetime& expiration);

Does that make sense? The functions from the parent class are being executed, when they are being overwritten in the child class ... Any help would be greatly appreciated!!

 
trolley:

Hi All,

I downloaded the signal from this article and created a MQ5 using the wizard, but the EA does not make any trades. Any ideas?

I had to make the change in the above comments to get the signal to show up in the list, apart from that it compiled OK. Running the EA in the strategy tester does not do anything though :( 

 

EDIT: After inserting print statements in all CSampleSignal class functions, and CExpertSignal class functions, it appears as if the inherited functions are not being overwritten by the CSampleSignal functions-

i.e. in this example, instead of these executing: 

 

The following are executed:

Does that make sense? The functions from the parent class are being executed, when they are being overwritten in the child class ... Any help would be greatly appreciated!!

Hi Trolley,

 

i have the same problem. Have you found any solution or idea on it?

 thanks

 

Good afternoon,

Please advise me how to increase (top up) a position in an Expert Advisor, which is written on the basis of MQL5 Wizard and where positions are opened via

virtual int LongCondition();
virtual int ShortCondition();

I wrote the robot according to the recommendations in the article

https://www.mql5.com/en/articles/367 "Create a trading robot in 6 steps" and it works fine, but attempts to influence the position size (no matter whether to increase or decrease)

(no matter whether to increase or decrease) through repeated generation of the condition in , for example in

LongCondition();

does not lead to anything, the already open position is not changed, it can only be deleted by executing the close condition or by triggering sl , tp.

I like the MQL5 Wizard, you can easily and quickly "build" a multi-indicator Expert Advisor, change the sl tracking module, change the money management module.

But my attempt to write an Expert Advisor that opens a minimum position when a condition is formed by one indicator and increases (fills) the position when the trend is confirmed by another indicator.

I came across the above described problem - the already opened position does not change when the signal to open it again is issued through. for example LongCondition();

Thank you.

Создай торговый робот за 6 шагов!
Создай торговый робот за 6 шагов!
  • 2012.06.01
  • MetaQuotes Software Corp.
  • www.mql5.com
Вы не знаете, как устроены торговые классы, и пугаетесь слов "Объектно-ориентированное программирование"? На самом деле вовсе не обязательно всё это знать, чтобы написать свой собственный модуль торговых сигналов - достаточно следовать простым правилам. Всё остальное сделает Мастер MQL5, и вы получите готовый торговый робот!
 
The file from the article is not visible in the wizard, who is in the subject, please tell me what to adjust.
 
thejobber:
The file from the article is not visible in the wizard, who is in the subject, please tell me what to tweak.

In the comments you need to replace the line

//| Type=Signal

to

//|| Type=SignalAdvanced.

After that my master started to see the signal.

 
Downloaded it, generated it through the Wizard, tried to run it in the tester. It doesn't work. It doesn't even access the CheckOpenLong/Short() methods in samplesignal. They are called in ExpertSignal, but not in SampleSignal. What else can I do to override them for sure?