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

 

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

Documentation on MQL5: Standard Constants, Enumerations and Structures / Trade Constants / Order Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Trade Constants / Order Properties - Documentation on MQL5
 
ssn:

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

 
Automated-Trading:

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

Hey I actually wrote buy_stop_limit and sell_stop_limit orders. Now yes you are right the price variable for each of these will be above Ask plus maximum of freeze and stops & below bid minus maximum of the same respectively. My question is how do we set the stoplimit price?
 
ssn:
Hey I actually wrote buy_stop_limit and sell_stop_limit orders. Now yes you are right the price variable for each of these will be above Ask plus maximum of freeze and stops & below bid minus maximum of the same respectively. My question is how do we set the stoplimit price?
Ok, now I see. The Buy Stop Limit and Sell Stop Limit orders are not used by CExpert (such orders may be useful for non-liquid stocks), so you need to write your own implementation.
 
Automated-Trading:
Ok, now I see. The Buy Stop Limit and Sell Stop Limit orders are not used by CExpert (such orders may be useful for non-liquid stocks), so you need to write your own implementation.

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

 
Why do I need the main class CExpertSignal? Let's say I put a collection of indicators into it, but what algorithm will it use to make a decision on opening a deal? If its descendants do everything, why make them (descendants) its descendants? Why can't they be made as base classes?
 
Burgunsky:
Why do I need the main class CExpertSignal? Let's say I put a collection of indicators into it, but what algorithm will it use to make a decision on opening a deal? If its descendants do everything, why make them (descendants) its descendants? Why can't they be made as base classes?
Please familiarise yourself with the basics of OOP, I would even say with the BASIC BASE...
 

Interesting:
Ознакомтесь плиз с основами ООП, я бы даже сказал С БАЗОВЫМИ ОСНОВАМИ...

In this particular case, inheritance is probably necessary only because the InitSignal method of the CExpert class understands only an object of type CExpertSignal or its descendant? And virtual methods in CExpertSignal are necessary for CExpert to correctly access methods of its descendant? The parent is just a template to build your class on. Am I right?

 

Более подробно класс CExpert и работа с ним будут рассмотрены в отдельной статье.

A separate article with details about the CExpert class and how to work with it hasn't appeared yet?

 

Is this article still relevant? I tried generating an Expert Advisor with the file attached here, it does not trade.