Writing an effective advisor - page 6

 
Vladimir Baskakov #:
You already know it will be 0. If it wasn't, you wouldn't have created this thread

Is there no other reason?

In short, I am fed up with all this idle chatter. If you continue the dialogue outside the EA thread, I will ignore your posts.

Your predictions are not interesting because they already contradict the effectiveness of the trading robot. My video shows you how to manage the trend line, to get a profit. If you can't learn it, you won't be able to use it. It's like playing a musical instrument. I, as a master, claim that the instrument is good. I know it, because I've been programming for forex for over 15 years. I gave you the tool. It's not a fact that you'll be able to masterfully use it.

And another thing, the tool I used in the video is not called a ray, it's called a trendline. The ray is the PARAMETER of this tool, which you can turn off if you wish.

That's the end of it. I don't want to touch any more unsubstantiated predictions.

 
Vitaly Murlenko #:

Is there no other reason?

In short, I am fed up with all this idle chatter. If you continue the dialogue outside the EA topic, I will ignore your posts.

Your predictions are not interesting because they already contradict the effectiveness of the trading robot. My video shows you how to manage the trend line, to get a profit. If you can't learn it, you won't be able to use it. It's like playing a musical instrument. I, as a master, claim that the instrument is good. I know it, because I've been programming for forex for over 15 years. I gave you the tool. It's not a fact that you'll be able to masterfully use it.

And another thing, the tool I used in the video is not called a ray, it's called a trendline. The ray is the PARAMETER of this tool, which you can turn off if you wish.

That's the end of it. I don't want to touch any more unsubstantiated predictions.

State where?
Comparing the number of red candles and blue candles is not the definition of a trend
 
Vladimir Baskakov #:
State where?
Comparing the number of red candles and blue candles is not trend detection

OK, but I'll show but intermediate result in real "live" conditions. Here's a screenshot:

Money entered yesterday at 3pm. There was zero (you'll have to take my word for it here).

Here's the state:

8

9

10

11

 
Will this state help your analytics?
 
Vitaly Murlenko #:
Will this state help your analysis?
Here's the State.
By the way, why bother looking for a trend when its continuation is 50/50 likely to reverse
 
Vitaly Murlenko #:

Attached to the post is the Expert Advisor (file Binarnic_1.0.mq4) and the script I used in the video (file Script_0.mq4).

To avoid misunderstandings, watch the video first. I watched my video with headphones - the sound seems to be all right.

I wanted to use it on YouTube, but google had messed up something with the security there, and I could not even understand it on my mobile. Anyway, I uploaded it to myl-ru in the cloud. Just download it, because the viewer of this server clearly suffers from quality. The file format is mp4. The file size is 252 megabytes. Here is a link to download:https://cloud.mail.ru/public/Ewoq/ymNxHFJ2Z

Good morning to all and good mood!

Vitaliy, do you plan to write the code of your Expert Advisor only for MT4 or will there be a version for MT5? I don't know about 4 because I've had a short course of self-study of MQL5 programming language, that's why I can hardly add anything to the code of your EA. Too bad!

Regards, Vladimir.

 
MrBrooklin #:

Good morning everyone and good mood!

Vitaliy, do you plan to write the code of your Expert Advisor only for MT4 or will there be a version for MT5? I do not know about 4 because I've had a short course of self-study of MQL5 programming language, that is why I will unlikely be able to add anything to your EA's code. Too bad!

Best regards, Vladimir.

MQL4 is not different from MQL5. The only difference is the access to data and trading functions. All this is "wrapped" in classes with a common virtual interface - and voila, we get a portable code that can be compiled in both cases without any changes.

 
Georgiy Merts #:

MQL4 is not different from MQL5. The only difference is the access to data and trading functions. All this is "wrapped" in classes with a common virtual interface - and voila, you get a portable code that can be compiled there and there without changes.

https://www.mql5.com/ru/docs/basis/preprosessor/conditional_compilation
 
Georgiy Merts #:

The only difference is in the data access and trading functions.


Not only that.

 

Exactly.

Just by using conditional compilation directives. All these directives work inside the real classes. We develop a virtual universal interface for trading actions and, in implementation classes, we separate MQL4-MQL5 branches using conditional compilation. We then simply create an object that will trade and access it using the virtual interface. And in general, we forget about all sorts of differences between platforms.

Let's say, here is my virtual interface of the trading processor:

// СTradeProcessorI - интерфейс торгового процессора

#include <MyLib\Common\MyObject.mqh>
#include <MyLib\Common\CurSymEnum.mq5>

class CTradePosComponentI;
class COrderInfoCore;

class CTradeProcessorI : public CMyObject
{
public:
   void CTradeProcessorI() {    SetMyObjectType(MOT_TRADE_PROCESSOR_I); };
   virtual void ~CTradeProcessorI() {};
   
   // Настроечный интерфейс
   virtual void SetSlippage(uint uiSlippage) = 0;
   
   // Торговый интерфейс
   // Все функции возвращают код возврата торгового сервера
   virtual int Buy(long & lTicket,ECurrencySymbol csSymbol,double dVolume,double dTP=0,double dSL=0,ulong ulMagic = 0,string strComment = NULL) = 0;               // Всегда по цене Ask, если успешно - возвращается lTicket
   virtual int Sell(long & lTicket,ECurrencySymbol csSymbol,double dVolume,double dTP=0,double dSL=0,ulong ulMagic = 0,string strComment = NULL) = 0;              // Всегда по цене Bid, если успешно - возвращается lTicket  

   virtual int ModifyTPSL(CTradePosComponentI* ptpcComponent,double dTP=0,double dSL=0) = 0;       
   virtual int ModifyTPSL(long lTPCTicket,double dTP=0,double dSL=0) = 0;       

   virtual int CloseTradeComponent(CTradePosComponentI* ptpcComponent,double dCloseVolume=EMPTY_VALUE) = 0;              // dCloseVolume - закрываемый объем. Если равен EMPTY_VALUE или равен или больше, чем объем торговой компоненты с указанным тикетом - закрывается вся торговая компонента.   
   virtual int CloseTradeComponent(long lTPCTicket,double dCloseVolume=EMPTY_VALUE) = 0;              // dCloseVolume - закрываемый объем. Если равен EMPTY_VALUE или равен или больше, чем объем торговой компоненты с указанным тикетом - закрывается вся торговая компонента.   
   
   virtual int PendingSet(long & lTicket,ECurrencySymbol csSymbol,ENUM_ORDER_TYPE otOrderType,double dSetPrice,double dVolume,double dTP=0,double dSL=0,ulong ulMagic = 0,string strComment = NULL) = 0; // если успешно - возвращается lTicket
   virtual int PendingDelete(long lTicket) = 0; 
   virtual int PendingDelete(COrderInfoCore* poiOrder) = 0; 
   
   virtual int PendingModify(long lTicket,double dSetPrice,double dTP=0,double dSL=0) = 0;       
   virtual int PendingModify(COrderInfoCore* poiOrder,double dSetPrice,double dTP=0,double dSL=0) = 0;       
   
   // Проверка кода возврата
   virtual bool TradeOperationWasSuccessful(int iTradeResCode) const = 0;
   
   // Если функция возвращает true, то при возникновении пользовательских ошибок (iTradeResCode > ERR_USER_ERROR_FIRST) советник прекратит работу
   // В случае false - работа будет продолжена
   virtual bool IsUserErrorsFalal() const = 0; 

};


All functions are virtual, and completely platform-independent. We have introduced a platform-independent concept of a "trade component" which represents either an individual MT4 order or an open position on a symbol in MT5. And it is this kind of trading component that we are working with.

The real class, implementing this interface, looks as follows:

// СTradeProcessor - переносимый класс торгового процессора
// Именно этот класс необходимо использовать для торговли. 
// Класс реализует интерфейс CTradeProcessorI

#ifdef __MQL5__
#include <MyLib\Trade\MT5TradeProcessor.mq5>
#else // __MQL5__
#include <MyLib\Trade\MT4TradeProcessor.mq5>
#endif //__MQL5__

#ifdef __MQL5__
class CTradeProcessor : public CMT5TradeProcessor
#else // __MQL5__
class CTradeProcessor : public CMT4TradeProcessor
#endif //__MQL5__

{
public:
   void CTradeProcessor(uint uiSlippage = DEFAULT_TRADE_POINT_SLIPPAGE);
   void ~CTradeProcessor() {};
};


In fact, the whole implementation takes place inside platform-dependent classes CMT5TradeProcessor and CMT4TradeProcessor.


Reason: