New article MQL5 Wizard: How to Create a Module of Trading Signals is published:
The article discusses how to write your own class of trading signals with the implementation of signals on the crossing of the price and the moving average, and how to include it to the generator of trading strategies of the MQL5 Wizard, as well as describes the structure and format of the description of the generated class for the MQL5 Wizard.
I have a question.
How do you send buy stop limit or sell stop limit orders with the inbuilt classes if you are creating your own module? Cannot find provision for stoplimit price
The order type (limit or stop) depends on price.
For example, to trade using buy stop orders you must specify the price, higher than current ask price.
The buy case (in CheckOpenLong):
For the case of the price inside the freeze level it will use the market price.
See example in MQL5 Wizard - Trade Signals Based on Crossover of Two EMA with intraday time filter
Non liquid stocks?... just testing EURUSD over a decade with stop limit orders and this strategy clearly outperforms the limit order option. Any way I hope metaquotes can provide an implementation to go with this not too bad library.
Thanks for the feedback
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
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 |
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!!