Preparing scalping - page 17

 
Igor Makanu:

Well, there is a question here, classes simplify software development time - let's say, if you write software on a flow (like on an assembly line - essentially assembling software)

but alas, miracles do not happen - to use the classes you need time to study them

but in terms of the standard classes from the delivery of MT, they can be used - there is a help, the classes are written in a good programming style, and quite easy to read

Not all of them are really usable. There are times when it's easier to write your own class, or at least copy the standard one and make the necessary changes.

 
SEM:

Will there be a version for MT5?

A small billet for MT5 (works in the tester).

Opens the next trade, if all previous ones by symbol and direction are in plus.

It works fine for a start... I have to finish it, because Lehi has no time... how to tie levels - maybe this script will dohttps://www.mql5.com/ru/code/20189

ProfLine
ProfLine
  • www.mql5.com
Скрипт рассчитывает и выводит на график уровни безубытка отдельно для открытых позиций BUY и SELL. После изменений количества позиций требуется повторный запуск скрипта.
 
Petros Shatakhtsyan:

I'm not talking about standard MQL classes, they make code much simpler. And you don't need to know OOP to use them at all.

Well, if you are already using the standard MQL classes, you are only one step away from OOP

If it makes sense to write a class, let's do it, if not - don't write it.

In the same graphics, without classes you can not, I caught up with my learning as early as TurboPascal and was at that time a graphical library for working with text panels, and the question was not about OOP - code windows and menus was so complicated that I gave up making something from this library, and after all from that library anyway it turned out NortonCommander

))))

And another example, MQL allows you to create a synthetic symbol, you can fill all fields of a new tool once from the code. - You'll have to create an array of structures or the like.

Or you can search the forums and find a ready solution in the form ofclass SYMBOL

https://www.mql5.com/ru/code/18855

Or we inherit and rewrite the methods we find better

Alas, we live in an age where the amount of information prevails over the ability of a person to study it, so one must search for and use ready-made solutions.

Symbol
Symbol
  • www.mql5.com
Библиотека содержит некоторый функционал, позволяющий разобраться на начальном этапе, как идет работа с кастомными символами, и предлагает некоторые готовые решения, могущие быть полезными. Пример При запуске бэктеста на кроссах тестер тянет за собой не только основной символ, но и вспомогательный, который позволяет конвертировать валюту...
 
Igor Makanu:

You have an optimistic scenario, I am a pessimist and see the following course of events: after dissection we get a 20-fold increase in the kukish! ))))

But here's the point:

That's clear, let's say these questions arise only for those who have read OOP for the first time, if we are now talking about the basic principles of OOP, then I am interested in the following questions

- how to inherit more than one parent class

- how to inherit from CObject the principles of linked lists, for example, I want to learn how to "cross" CLabel with CObject, the result will be CLabel .Prev , CLabel .Next and similar methods

You can't do this in MQL, not even in the form of interfaces.

There are no principles of inheritance there, there are dummy functions, you just have to do everything yourself. The class consists of several strings

class CObject
  {
private:
   CObject          *m_prev;               // previous item of list
   CObject          *m_next;               // next item of list

public:
                     CObject(void): m_prev(NULL),m_next(NULL)            {                 }
                    ~CObject(void)                                       {                 }
   //--- methods to access protected data
   CObject          *Prev(void)                                    const { return(m_prev); }
   void              Prev(CObject *node)                                 { m_prev=node;    }
   CObject          *Next(void)                                    const { return(m_next); }
   void              Next(CObject *node)                                 { m_next=node;    }
   //--- methods for working with files
   virtual bool      Save(const int file_handle)                         { return(true);   }
   virtual bool      Load(const int file_handle)                         { return(true);   }
   //--- method of identifying the object
   virtual int       Type(void)                                    const { return(0);      }
   //--- method of comparing the objects
   virtual int       Compare(const CObject *node,const int mode=0) const { return(0);      }
  };
 
Igor Makanu:

Well, there is a question here, classes simplify software development time - let's say, if you write software on a flow (like on an assembly line - essentially assembling software)

but alas, miracles do not happen - to use the classes you need time to study them

but in terms of the standard classes from the MT toolkit, they are usable - there is help and the classes are written in a good programming style, and fairly easy to read

And many are very efficiently written, for example CHashMap breaks all analogues which were published here in articles and kodobase. And I use hash tables very extensively.

 
Сергей Криушин:

Works great for a start... We need to finish it, Lekha has no time... how to link levels - maybe this script will workhttps://www.mql5.com/ru/code/20189

Alas, Lekha needs to earn some food )). Will do, but not instantly.

 
Igor Makanu:

In the same graphics, you can't do without classes, I caught up with TurboPascal during my studies and at that time there was a graphics library for working with text panels, and there was no talk about OOP - code of windows and menus was so complicated that I was reluctant to make something from such library, and however you want, that library turned into NortonCommander anyway

I remember that some rudiments of OOP appeared in TP 7

 
Alexey Volchanskiy:

Alas, Lekha has to earn his munchies too )) Will do, but not instantly

Put your web money account in the profile...and we'll fill it up...good riddance...for your efforts and inspiration... You do not work for your own sake for the common good and understanding of the truth ...

 
Сергей Криушин:

Put a web money account in your profile....and we'll give you a handout....for your hard work and inspiration... You're not doing this just for yourself for the common good and understanding the truth...

As a deeply cynical man, I do not believe in miracles )))) But, as a social experiment, I wrote purses. Maybe a miracle will happen and a coin will bounce in the VM, and my heart will melt, and I'll use it to feed stray kittens )) Or pick up and fly a duck with a broken wing from a nearby lake. But I promise not to drink it, waste it on pussy or lose it at cards!https://www.mql5.com/ru/users/vdev


Alexey Volchanskiy
Alexey Volchanskiy
  • www.mql5.com
Опубликовал пост ScalpHunter2 v1.38_EN.ex4 Немного измененная версия, из-за чемпионата не получилось много поработать, внизу смотрите ScalpHunter2 v1.38_EN.zip, работает до 2018.07.31, настройки те же... Добавил тему Шифрование программ? Тут коллега спрашивает, ломаются ли программы из Маркета и обычные, зашифрованные на Сервере MQ? Кто не в...
 
I updated the project in the repository, I basically added the CM1PivotLevels class. The project is stored in the Vault at "MQL5\Shared Projects\PrepareScalping". It is not working yet, I will finish it soon.