Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moves Indicator and Serializer class related files to own dirs #659

Merged
merged 3 commits into from
Aug 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/test-indicator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,10 @@ jobs:
strategy:
matrix:
test:
- Indicator.test
- IndicatorBase.test
- IndicatorCandle.test
- IndicatorData.test
- IndicatorTf.test
- IndicatorTick.test
steps:
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/test-serializer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
name: Test Serializer

# yamllint disable-line rule:truthy
on:
pull_request:
paths:
- 'Serializer/**'
- '.github/workflows/test-serializer.yml'
push:
paths:
- 'Serializer/**'
- '.github/workflows/test-serializer.yml'

jobs:

Compile:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Compile
uses: fx31337/mql-compile-action@master
with:
init-platform: true
path: 'serializer/tests'
verbose: true
- name: Print compiled files
run: '(Get-ChildItem -Recurse -Path . -Include *.ex[45]).fullname'
shell: powershell
- name: Upload artifacts (MQL4)
uses: actions/upload-artifact@v2
with:
name: files-ex4
path: '**/*.ex4'
- name: Upload artifacts (MQL5)
uses: actions/upload-artifact@v2
with:
name: files-ex5
path: '**/*.ex5'

Serializer-Tests-MQL4:
defaults:
run:
shell: bash
working-directory: serializer/tests
needs: Compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Serializer.test
steps:
- uses: actions/download-artifact@v2
with:
name: files-ex4
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
BtDays: 4-8
BtMonths: 1
BtYears: 2021
MtVersion: 4.0.0.1359
RunOnError: show_logs 200
TestExpert: ${{ matrix.test }}
timeout-minutes: 10
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ jobs:
- DatabaseTest
- DrawIndicatorTest
- EATest
- IndicatorTest
- IndicatorsTest
- MailTest
- MarketTest
Expand Down Expand Up @@ -111,7 +110,6 @@ jobs:
- OrderQuery
- ProfilerTest
- RefsTest
- SerializerTest
- TerminalTest
- TimerTest
- ValueStorageTest
Expand Down
6 changes: 3 additions & 3 deletions 3D/Chart3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
*/

#include "../Bar.struct.h"
#include "../IndicatorData.mqh"
#include "../Indicator/IndicatorData.h"
#include "../Indicators/Indi_MA.mqh"
#include "../Instances.h"
#include "../Refs.mqh"
#include "../SerializerConverter.mqh"
#include "../SerializerJson.mqh"
#include "../Serializer/SerializerConverter.h"
#include "../Serializer/SerializerJson.h"
#include "Chart3DCandles.h"
#include "Chart3DType.h"
#include "Cube.h"
Expand Down
2 changes: 1 addition & 1 deletion Account/Account.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Includes.
#include "../BufferStruct.mqh"
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "AccountBase.h"

/**
Expand Down
2 changes: 1 addition & 1 deletion Account/Account.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
1 change: 0 additions & 1 deletion Account/AccountBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#define ACCOUNTBASE_H

// Includes.
//#include "../Serializer.mqh"
#include "../Refs.mqh"
#include "AccountBase.struct.h"

Expand Down
2 changes: 1 addition & 1 deletion Account/AccountBase.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
2 changes: 1 addition & 1 deletion Account/AccountForex.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#define ACCOUNTFOREX_H

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "Account.h"
#include "AccountForex.struct.h"

Expand Down
2 changes: 1 addition & 1 deletion Account/AccountForex.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
class Serializer;

// Includes.
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
5 changes: 2 additions & 3 deletions Account/AccountMt.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,12 @@ class AccountMt;
// Includes.
#include "../Array.mqh"
#include "../BufferStruct.mqh"
#include "../Chart.mqh"
#include "../Convert.mqh"
#include "../Data.struct.h"
#include "../Indicator.struct.h"
#include "../Indicator/Indicator.struct.h"
#include "../Order.struct.h"
#include "../Orders.mqh"
#include "../Serializer.mqh"
#include "../Serializer/Serializer.h"
#include "../SymbolInfo.mqh"
#include "../Trade.struct.h"
#include "Account.define.h"
Expand Down
11 changes: 5 additions & 6 deletions Bar.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,16 @@ class Serializer;
// Includes.
#include "Bar.enum.h"
#include "Chart.enum.h"
#include "ISerializable.h"
#include "Serializer.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/Serializable.h"
#include "Serializer/Serializer.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Std.h"
#include "Serializer/Serializer.h"

/* Struct for storing OHLC values. */
struct BarOHLC
#ifndef __MQL__
: public ISerializable
: public Serializable
#endif
{
datetime time;
Expand Down Expand Up @@ -230,8 +231,6 @@ struct BarOHLC
string ToCSV() { return StringFormat("%d,%g,%g,%g,%g", time, open, high, low, close); }
};

#include "Serializer.mqh"

/* Method to serialize BarOHLC structure. */
SerializerNodeType BarOHLC::Serialize(Serializer &s) {
// s.Pass(THIS_REF, "time", TimeToString(time));
Expand Down
2 changes: 1 addition & 1 deletion Buffer/BufferTick.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "../BufferStruct.mqh"
#include "../Chart.enum.h"
#include "../Storage/IValueStorage.h"
#include "../Tick.struct.h"
#include "../Tick/Tick.struct.h"

// TV = Type of price stored by BufferTick. RV = Type of property to be retrieved from BufferTick.
template <typename TV, typename RV>
Expand Down
3 changes: 1 addition & 2 deletions BufferFXT.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@

// Includes.
#include "Account/AccountMt.h"
#include "Chart.mqh"
#include "DictStruct.mqh"
#include "IndicatorBase.h"
#include "Indicator/IndicatorData.h"
#include "Object.mqh"

// Defines.
Expand Down
2 changes: 1 addition & 1 deletion BufferStruct.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
// Includes.
#include "DictBase.mqh"
#include "DictStruct.mqh"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"

/**
* Implements BufferStruct's Overflow Listener.
Expand Down
11 changes: 5 additions & 6 deletions Candle.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,17 @@ class Serializer;
// Includes.
#include "Bar.enum.h"
#include "Chart.enum.h"
#include "ISerializable.h"
#include "Serializer.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/Serializable.h"
#include "Serializer/Serializer.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Std.h"
#include "Serializer/Serializer.h"

/* Structure for storing OHLC values. */
template <typename T>
struct CandleOHLC
#ifndef __MQL__
: public ISerializable
: public Serializable
#endif
{
T open, high, low, close;
Expand Down Expand Up @@ -276,8 +277,6 @@ struct CandleTOHLC : CandleOHLC<T> {
string ToCSV() { return StringFormat("%d,%g,%g,%g,%g", time, open, high, low, close); }
};

#include "Serializer.mqh"

/* Method to serialize CandleEntry structure. */
template <typename T>
SerializerNodeType CandleOHLC::Serialize(Serializer &s) {
Expand Down
10 changes: 5 additions & 5 deletions Chart.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
* - https://www.mql5.com/en/docs/series
*/

// Class dependencies.
class Chart;
class Market;

// Prevents processing this includes file for the second time.
#ifndef CHART_MQH
#define CHART_MQH
Expand All @@ -44,9 +40,13 @@ class Market;
#include "Chart.struct.serialize.h"
#include "Convert.mqh"
#include "Market.mqh"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"
#include "Task/TaskCondition.enum.h"

// Forward class declaration.
class Chart;
class Market;

#ifndef __MQL4__
// Defines structs (for MQL4 backward compatibility).
// Struct arrays that contains given values of each bar of the current chart.
Expand Down
4 changes: 3 additions & 1 deletion Chart.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

// Forward class declaration.
class Class;
struct ChartTf;

// Includes.
#include "Array.mqh"
Expand All @@ -40,7 +41,8 @@ class Class;
#include "Chart.enum.h"
#include "Chart.struct.static.h"
#include "Chart.struct.tf.h"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNode.enum.h"
#include "Terminal.define.h"

/* Defines struct to store bar entries. */
Expand Down
6 changes: 3 additions & 3 deletions Chart.struct.serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
class Serializer;

// Includes.
#include "Serializer.mqh"
#include "SerializerNode.enum.h"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNode.enum.h"

/* Method to serialize ChartEntry structure. */
SerializerNodeType ChartEntry::Serialize(Serializer& _s) {
Expand All @@ -42,6 +42,6 @@ SerializerNodeType ChartEntry::Serialize(Serializer& _s) {
SerializerNodeType ChartParams::Serialize(Serializer& s) {
s.Pass(THIS_REF, "id", id);
s.Pass(THIS_REF, "symbol", symbol);
s.PassStruct(THIS_REF, "tf", tf);
// s.PassStruct(THIS_REF, "tf", tf); // @fixme
return SerializerNodeObject;
}
6 changes: 5 additions & 1 deletion Chart.struct.tf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,14 @@
#pragma once
#endif

// Forward declarations.
class Serializer;

// Includes.
#include "Chart.enum.h"
#include "Serializer.mqh"
#include "Serializer/SerializerNode.enum.h"
#include "Terminal.define.h"
#include "Serializer/Serializer.h"

/* Defines struct for chart timeframe. */
struct ChartTf {
Expand Down
1 change: 1 addition & 0 deletions ChartMt.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#endif

// Includes.
#include "Chart.struct.static.h"
#include "Chart.symboltf.h"
#include "Terminal.define.h"

Expand Down
2 changes: 1 addition & 1 deletion Config.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
#include "DictStruct.mqh"
#include "File.mqh"
#include "Object.mqh"
#include "Serializer.mqh"
#include "Serializer/Serializer.h"

enum CONFIG_FORMAT { CONFIG_FORMAT_JSON, CONFIG_FORMAT_JSON_NO_WHITESPACES, CONFIG_FORMAT_INI };

Expand Down
7 changes: 3 additions & 4 deletions Data.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ struct MqlRates;
// Includes.
#include "Data.enum.h"
#include "DateTime.mqh"
#include "Serializer.enum.h"
#include "SerializerNode.enum.h"
#include "Serializer/Serializer.enum.h"
#include "Serializer/SerializerNode.enum.h"
#include "Std.h"
#include "Serializer/Serializer.h"

#ifndef __MQL__
/**
Expand Down Expand Up @@ -330,8 +331,6 @@ struct DataParamEntry : public MqlParam {
SerializerNodeType Serialize(Serializer &s);
};

#include "Serializer.mqh"

/* Method to serialize DataParamEntry struct. */
SerializerNodeType DataParamEntry::Serialize(Serializer &s) {
s.PassEnum(THIS_REF, "type", type, SERIALIZER_FIELD_FLAG_HIDDEN);
Expand Down
4 changes: 2 additions & 2 deletions Dict.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
#include "Convert.mqh"
#include "DictBase.mqh"
#include "Matrix.mqh"
#include "Serializer.mqh"
#include "SerializerNodeIterator.mqh"
#include "Serializer/Serializer.h"
#include "Serializer/SerializerNodeIterator.h"

template <typename K, typename V>
class DictIterator : public DictIteratorBase<K, V> {
Expand Down
Loading
Loading