Skip to content

Commit

Permalink
WIP. Indicators' refactoring as Indicator is now a template class. Ad…
Browse files Browse the repository at this point in the history
…ded IndicatorBase class.

Most of the indicators under `indicators.h` now compiles.
  • Loading branch information
nseam committed Sep 29, 2021
1 parent 3e30494 commit 3753c1f
Show file tree
Hide file tree
Showing 32 changed files with 1,367 additions and 612 deletions.
1 change: 1 addition & 0 deletions Draw.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Draw;

// Includes.
#include "Chart.mqh"
#include "Data.define.h"

#ifndef __MQL4__
// Defines macros (for MQL4 backward compatibility).
Expand Down
7 changes: 3 additions & 4 deletions DrawIndicator.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "Object.mqh"

// Forward declaration.
class Indicator;
class IndicatorBase;

class DrawPoint {
public:
Expand All @@ -52,12 +52,11 @@ class DrawPoint {
DrawPoint(datetime _time = NULL, double _value = 0) : time(_time), value(_value) {}
};

template <typename IDT>
class DrawIndicator {
protected:
color color_line;
Draw* draw;
Indicator<IDT>* indi;
IndicatorBase* indi;

public:
// Object variables.
Expand All @@ -68,7 +67,7 @@ class DrawIndicator {
/**
* Class constructor.
*/
DrawIndicator(Indicator<IDT> *_indi) : indi(_indi) {
DrawIndicator(IndicatorBase* _indi) : indi(_indi) {
// color_line = Object::IsValid(_indi) ? _indi.GetParams().indi_color : clrRed; // @fixme
draw = new Draw();
}
Expand Down
Loading

0 comments on commit 3753c1f

Please sign in to comment.