Channel design indicator – indicator MetaTrader 5

Parameterization
Application The indicator can be utilized into any symbol or timeframe, there are no restrictions. Inputs For the creation of the channel are required the definition of two inputs: //— input parameters input int barsChannel = 200; // Channel creation length input int barsMulti   = 5;   // Channel bars to peak/valley The “barsChannel” input defines … Read more

Design patterns – Twin – library MetaTrader 5

Design patterns - Twin - library for MetaTrader 5
/**/ #include <SRCPatterns_Main.mqh> namespace Twin { /************************************************************************************** Design patterns – Twin    Modeling multiple inheritance with the Twin pattern. /************************************************************************************** Structure        +——-+        +——-+        |Parent1|        |Parent1|        +——-+        +——-+        | M1()  |        | M2()  |        +——-+        +——-+           ^                 ^           |                 |      +—-|—————–|—-+      | +——+         +——+ |      | |Child1|  twin   |Child1| |      | +——+ ——> +——+ | … Read more

Design patterns – Abstract Factory – library MetaTrader 5

Design patterns - Abstract Factory - library for MetaTrader 5
//+—————-+—————————————————————————————-+ //|    Abstract    | Provide an interface for creating families of related or dependent objects without     | //|     Factory    | specifying their concrete classes.                                                     | //+—————-+—————————————————————————————-+ //|      When      | 1) a system should be independent of how its products are created, composed, and       | //|                | represented. 2) a system should be configured with one of multiple families of         | //|                | … Read more

Design patterns – Builder – library MetaTrader 5

Design patterns - Builder - library for MetaTrader 5
//———————————————————————————————- //BUILDER – A CREATIONAL PATTERN // | INTENT // |  | for a complex object // |  |  | separate its construction from representation // |  |  | same construction process // |  |  |  | can create different representations // | APPLICABILITY —————————————————————————– // |  | algorithm for creating a complex object should be // |  |  | independent of the parts // |  |  |  | … Read more

Design patterns – Factory Method – library MetaTrader 5

Design patterns - Factory Method - library for MetaTrader 5
//FACTORY METHOD ——————————————————————————- // | GROUP // |  | creational // | INTENT // |  | interface for creating an object // |  |  | defers instantiation to subclasses // |  | subclasses decide which class to instantiate // | BENEFITS // |  | aspects of the code that may vary // |  |  | subclass of object that is instantiated // |  | … Read more

Design patterns – Prototype (creational) – library MetaTrader 5

Design patterns - Prototype (creational) - library for MetaTrader 5
//—prototype——————————————————– //   creational design pattern //   —intent //      create objects by copying a prototype //   —benefits—————————————————— //      class of object that is instantiated may vary //      —refactoring problem //         creating an object by specifying a class explicitly //         —solution //            create objects indirectly //            also abstract factory, factory method //   —applicability ———————————————— //      classes to instantiate are specified at run-time //      no … Read more

Singleton – creational design pattern – library MetaTrader 5

Singleton - creational design pattern - library for MetaTrader 5
//—singleton——————————————————– //   creational design pattern //   —intent //      ensure one instance of a class with a global point of access //   —benefits //      the sole instance of a class may vary //   —applicability————————————————- //      one instance of a class //         accessible to clients from a well-known access point //         extensible by subclassing //            extended instance should be good without … Read more

All creational design patterns – library MetaTrader 5

All creational design patterns - library for MetaTrader 5
//+——————————————————————+ //|                                             PatternOrganizer.mqh | //|                                    2019-2020, dimitri pecheritsa | //|                                                 792112@gmail.com | //+——————————————————————+ //| 23 design patterns                                               | //+——————————————————————+ //   design patterns: elements of reusable object-oriented software //   gof > erich gamma, richard helm, ralph johnson, john vlissides //   published in 1994 //+——————————————————————+ //| classification                                                   | //+——————————————————————+ //   purpose > creational > 5 //      abstract factory, builder, … Read more

Adapter – structural design pattern – library MetaTrader 5

Adapter - structural design pattern - library for MetaTrader 5
//—adapter———————————————————- //   structural design pattern //—adapter > intent //   convert the interface of a class into another expected interface //   classes with incompatible interfaces can work together //—adapter > benefits———————————————– //   interface to an object my vary //   refactoring problem resolved //      inability to alter classes conveniently //      also decorator, visitor //—adapter > applicability—————————————— //   interface does … Read more

Bridge – structural design pattern – library MetaTrader 5

Bridge - structural design pattern - library for MetaTrader 5
//+——————————————————————+ //|                                                       Bridge.mqh | //|                                     2019-2020, dmitri pecheritsa | //|                                                 792112@gmail.com | //+——————————————————————+ //| bridge > structural design pattern                               | //+——————————————————————+ //   design patterns: elements of reusable object-oriented software //   gof > erich gamma, richard helm, ralph johnson, john vlissides //   published in 1994 //+——————————————————————+ //| intent                                                           | //+——————————————————————+ //   abstraction and implementation > decoupled, … Read more