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

v3.003-dev-new #744

Open
wants to merge 30 commits into
base: v3.002-dev-new
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
19da857
Adds initial .vscode/settings.json
kenorb Apr 19, 2024
b676982
Adds DavidAnson.vscode-markdownlint extension to devcontainer
kenorb Apr 19, 2024
f55eb87
Adds wine to devcontainer
kenorb Apr 19, 2024
111e4ee
devcontainer: Adds node
kenorb Apr 19, 2024
0873c08
Disables wine package
kenorb Apr 19, 2024
ca96c21
Fixes new lines [end-of-file-fixer]
kenorb Apr 19, 2024
4842049
Adds EA31337.vscode-mql-tools extension
kenorb Apr 19, 2024
505c0fb
GHA: Compile: Skips clean-up by default
kenorb Apr 23, 2024
cc5decc
CGA(Trade): proposal for macor based computation of SIGNAL BUY/SELL C…
cgava Apr 23, 2024
bce372b
Renames TradeEnumMacro.mq4 to TradeSignalEnumMacro.test.mq5
kenorb Apr 23, 2024
d5fad4c
Adds a wrapper file for TradeSignalEnumMacro
kenorb Apr 23, 2024
8ff1b3a
Moves enum macros into the main file and fixes compilation errors
kenorb Apr 23, 2024
990d9eb
Trade: TradeSignalEnumMacro: Fixes includes to use local path
kenorb Apr 23, 2024
d4d8f50
GHA: Compile: Support for workflow calls
kenorb Apr 23, 2024
db4c9e3
Task: Moves Task to Task/ directory
kenorb Oct 6, 2021
4154ad7
Renames Condition to TaskCondition
kenorb Oct 6, 2021
629ed8f
Renames Action to TaskAction
kenorb Oct 6, 2021
e04a0c3
Added `-c` option for `g++`
nseam Feb 17, 2022
f2c72e5
Fixed "cannot instantiate abstract class" due to deserialize code try…
nseam Feb 17, 2022
3705f17
GHA: Installs Emscripten toolchain
kenorb Feb 17, 2022
ea576b6
Merge branch 'v3.002-dev-new' into v3.003-dev-new
kenorb Apr 25, 2024
35ffd93
C++ compatibility fixes.
nseam Feb 21, 2022
c3ca6da
Minor fixes
nseam Feb 18, 2022
1f1c72d
Fixes nullptr undeclared identifier
kenorb Apr 25, 2024
5e57d6c
SerializerConverter: Fixes error: member reference base type 'C *' is…
kenorb Apr 25, 2024
20dfb4e
Merge branch 'v3.001-dev-new-stuff' into v3.003-dev-new
kenorb Apr 25, 2024
01cf6c9
Merge remote-tracking branch 'origin/v3.001-dev-new-cgava' into v3.00…
kenorb Apr 25, 2024
7bb64fa
ACQUIRE_BUFFERn / RELEASE_BUFFERn functionality required for EA31337/…
nseam Mar 18, 2024
5cb35fd
Merge remote-tracking branch 'origin/v3.002-dev-new' into v3.003-dev-new
kenorb Apr 27, 2024
7d24ab5
IndicatorData: Adds Set()
kenorb Oct 10, 2024
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
9 changes: 6 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
"customizations": {
"vscode": {
"extensions": [
"L-I-V.mql-tools",
"ms-vscode.cpptools",
"vscodevim.vim"
"vscodevim.vim",
"DavidAnson.vscode-markdownlint",
"EA31337.vscode-mql-tools"
],
}
},
Expand All @@ -18,7 +19,9 @@
"ghcr.io/guiyomh/features/vim:0": {},
"ghcr.io/jungaretti/features/make:1": {},
"ghcr.io/prulloac/devcontainer-features/pre-commit:1": {},
"ghcr.io/hspaans/devcontainer-features/ansible-lint:1": {}
"ghcr.io/hspaans/devcontainer-features/ansible-lint:1": {},
// "ghcr.io/maks1ms/devcontainers-features/wine:0": {},
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {}
},
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/compile-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,13 @@ jobs:
file: ${{ fromJson(needs.FileList.outputs.filelist) }}
steps:
- uses: actions/checkout@v2
- name: Install compiler
- name: Install Emscripten toolchain
uses: mymindstorm/setup-emsdk@v11
- name: Install CPP compiler
uses: rlalik/[email protected]
with:
compiler: gcc-latest
- name: Compile ${{ matrix.file }}
run: g++ "${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via emcc
run: emcc "${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via g++
run: g++ -c "${{ matrix.file }}"
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ jobs:
matrix:
test:
- AccountTest
- ActionTest
- BufferStructTest
- BufferTest
- ChartTest
- CompileIndicatorsTest
- ConditionTest
- DatabaseTest
# - DrawIndicatorTest
- EATest
Expand All @@ -62,7 +60,6 @@ jobs:
- StrategyTest-RSI
- SymbolInfoTest
- SummaryReportTest
- TaskTest
- TickerTest
- TradeTest
steps:
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"indicatorcandle.h": "c"
}
}
2 changes: 1 addition & 1 deletion Chart.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class Market;
#include "Chart.enum.h"
#include "Chart.struct.h"
#include "Chart.struct.serialize.h"
#include "Condition.enum.h"
#include "Convert.mqh"
#include "Market.mqh"
#include "Serializer.mqh"
#include "Task/TaskCondition.enum.h"

#ifndef __MQL4__
// Defines structs (for MQL4 backward compatibility).
Expand Down
111 changes: 0 additions & 111 deletions Condition.struct.h

This file was deleted.

2 changes: 1 addition & 1 deletion DictIteratorBase.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class DictIteratorBase {
bool IsLast() {
if (!IsValid()) return true;

if (_dict PTR_DEREF GetMode() == DictModeUnknown || _dict.Size() == 0) {
if (_dict PTR_DEREF GetMode() == DictModeUnknown || _dict PTR_DEREF Size() == 0) {
return false;
}

Expand Down
14 changes: 7 additions & 7 deletions DictObject.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ class DictObject : public DictBase<K, V> {
else
slot = GetSlotByKey(this PTR_DEREF _DictSlots_ref, key, position);

if (slot == NULL || !slot.IsUsed()) return NULL;
if (slot == NULL || !slot PTR_DEREF IsUsed()) return NULL;

return &slot.value;
return &slot PTR_DEREF value;
}

/**
Expand All @@ -156,7 +156,7 @@ class DictObject : public DictBase<K, V> {

if (!slot) return NULL;

return &slot.value;
return &slot PTR_DEREF value;
}

/**
Expand All @@ -171,7 +171,7 @@ class DictObject : public DictBase<K, V> {
return NULL;
}

return &slot.value;
return &slot PTR_DEREF value;
}

/**
Expand All @@ -186,7 +186,7 @@ class DictObject : public DictBase<K, V> {

if (!slot) return false;

return slot.value == value;
return slot PTR_DEREF value == value;
}

/**
Expand Down Expand Up @@ -265,7 +265,7 @@ class DictObject : public DictBase<K, V> {
if (this PTR_DEREF overflow_listener != NULL) {
if (!this PTR_DEREF overflow_listener(DICT_OVERFLOW_REASON_TOO_MANY_CONFLICTS, dictSlotsRef._num_used,
_num_conflicts)) {
// Overflow listener returned false so we won't search for further empty slot.
// Overflow listener returned false so we won't search for further empty slot PTR_DEREF
_overwrite_slot = true;
break;
}
Expand All @@ -285,7 +285,7 @@ class DictObject : public DictBase<K, V> {
// Overwriting starting position for faster further lookup.
position = _starting_position;
} else {
// Slot overwrite is not needed. Using empty slot.
// Slot overwrite is not needed. Using empty slot PTR_DEREF
++dictSlotsRef._num_used;
}

Expand Down
12 changes: 6 additions & 6 deletions DictStruct.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ class DictStruct : public DictBase<K, V> {
else
slot = GetSlotByKey(_DictSlots_ref, key, position);

if (slot == NULL || !slot.IsUsed()) {
if (slot == NULL || !slot PTR_DEREF IsUsed()) {
Alert("Invalid DictStruct key \"", key, "\" (called by [] operator). Returning empty structure.");
DebugBreak();
static V _empty;
return _empty;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand All @@ -166,7 +166,7 @@ class DictStruct : public DictBase<K, V> {
return _empty;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand All @@ -183,7 +183,7 @@ class DictStruct : public DictBase<K, V> {
return _default;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand All @@ -199,7 +199,7 @@ class DictStruct : public DictBase<K, V> {
return _empty;
}

return slot.value;
return slot PTR_DEREF value;
}

/**
Expand Down Expand Up @@ -231,7 +231,7 @@ class DictStruct : public DictBase<K, V> {

if (!slot) return false;

return slot.value == value;
return slot PTR_DEREF value == value;
}

/**
Expand Down
6 changes: 3 additions & 3 deletions EA.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
#define EA_MQH

// Includes.
#include "Action.enum.h"
#include "Chart.mqh"
#include "Condition.enum.h"
#include "Data.struct.h"
#include "Dict.mqh"
#include "DictObject.mqh"
Expand All @@ -46,7 +44,9 @@
#include "SerializerSqlite.mqh"
#include "Strategy.mqh"
#include "SummaryReport.mqh"
#include "Task.mqh"
#include "Task/Task.h"
#include "Task/TaskAction.enum.h"
#include "Task/TaskCondition.enum.h"
#include "Terminal.mqh"
#include "Trade.mqh"
#include "Trade/TradeSignal.h"
Expand Down
4 changes: 2 additions & 2 deletions EA.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// Includes.
#include "DateTime.mqh"
#include "Task.struct.h"
#include "Task/Task.struct.h"

/* Defines EA config parameters. */
struct EAParams {
Expand Down Expand Up @@ -225,7 +225,7 @@ struct EAState {
public: // @todo: Move to protected.
DateTime last_updated; // Last updated.
protected:
unsigned int flags; // Action flags.
unsigned int flags; // TaskAction flags.
unsigned int new_periods; // Started periods.
public:
/* Struct's enumerations */
Expand Down
10 changes: 10 additions & 0 deletions IndicatorData.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,16 @@ class IndicatorData : public IndicatorBase {
return _price;
}

/* Setters */

/**
* Sets the value for IndicatorDataParams struct.
*/
template <typename T>
void Set(STRUCT_ENUM_IDATA_PARAM _param, T _value) {
idparams.Set<T>(_param, _value);
}

/* State methods */

/**
Expand Down
6 changes: 3 additions & 3 deletions Indicators/Indi_Drawer.mqh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
struct IndicatorParams;

// Includes.
#include "../Action.mqh"
#include "../DictStruct.mqh"
#include "../Indicator/IndicatorTickOrCandleSource.h"
#include "../Redis.mqh"
#include "../Task/TaskAction.h"
#include "Indi_Drawer.struct.h"
#include "Price/Indi_Price.mqh"

Expand Down Expand Up @@ -106,7 +106,7 @@ class Indi_Drawer : public IndicatorTickOrCandleSource<IndiDrawerParams> {
virtual void OnTick() {
Indicator<IndiDrawerParams>::OnTick();

ActionEntry action(INDI_ACTION_SET_VALUE);
TaskActionEntry action(INDI_ACTION_SET_VALUE);
ArrayResize(action.args, 3);
action.args[0].type = TYPE_LONG;
action.args[0].integer_value = GetBarTime();
Expand All @@ -133,7 +133,7 @@ class Indi_Drawer : public IndicatorTickOrCandleSource<IndiDrawerParams> {
Print("Got: ", message.Message);
#endif
if (message.Command == "message" && message.Channel == "INDICATOR_DRAW") {
ActionEntry action_entry;
TaskActionEntry action_entry;
SerializerConverter::FromString<SerializerJson>(message.Message).ToObject(action_entry);
ExecuteAction((ENUM_INDICATOR_ACTION)action_entry.action_id, action_entry.args);
#ifdef __debug__
Expand Down
Loading
Loading