2026-08-06 00:19:26 +02:00 | | | //+------------------------------------------------------------------+
|
| | | //| Chapter2.mqh |
|
| | | //| Copyright 2025, MetaQuotes Ltd. |
|
| | | //| https://www.mql5.com |
|
| | | //+------------------------------------------------------------------+
|
| | | #property copyright "Copyright 2025, MetaQuotes Ltd."
|
| | | #property link "https://www.mql5.com"
|
| | | #property version "1.00"
|
| | |
|
| | | #include "IAnalyser.mqh"
|
2026-08-14 16:18:08 +02:00 | | | #include "../Configs/TfBarSeries.mqh"
|
2026-08-06 00:19:26 +02:00 | | | //+------------------------------------------------------------------+
|
| | | //| |
|
| | | //+------------------------------------------------------------------+
|
| | | class Chapter2: public IAnalyser//---
|
| | | {
|
2026-08-14 16:18:08 +02:00 | | | private:
|
| | | bool isStartup;
|
2026-08-06 00:19:26 +02:00 | | | public:
|
| | |
|
| | | Chapter2() {}
|
2026-08-09 07:14:59 +02:00 | | | ~Chapter2() {}
|
2026-08-06 00:19:26 +02:00 | | |
|
2026-08-14 16:18:08 +02:00 | | |
|
| | |
|
| | | virtual string GetAnalyserName() override { return "Chapter2"; }
|
| | |
|
| | | virtual void ProcessBar(TfBarSeries &series, int barIndex) override
|
| | | {
|
| | |
|
| | |
|
| | | //detectSwings(series, barIndex);
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | void detectSwings(TfBarSeries &series, int barIndex)
|
| | | {
|
| | | int sB = barIndex - 3;
|
| | | if(IsSwingHigh(barIndex - 3, series.GetIndicator(0)))
|
| | | {Print("IsSwingHigh");
|
| | |
|
| | | SwingDetactedEvent* s = new SwingDetactedEvent(series.symbol, series.tf, BULL, series.Time(sB), series.High(sB));
|
| | | eventBus.Push(s);
|
| | | }
|
| | |
|
| | | if(IsSwingLow(barIndex - 3, series.GetIndicator(0)))
|
| | | {Print("IsSwingLow");
|
| | |
|
| | | SwingDetactedEvent* s = new SwingDetactedEvent(series.symbol, series.tf, BEAR, series.Time(sB), series.Low(sB));
|
| | | eventBus.Push(s);
|
| | | }
|
| | |
|
| | | }
|
2026-08-09 07:14:59 +02:00 | | |
|
| | | bool isBullCandle(double open, double close)
|
| | | {
|
| | |
|
| | | return (open < close);
|
2026-08-06 00:19:26 +02:00 | | | }
|
| | | };
|
| | | //+------------------------------------------------------------------+
|