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.008-dev-new #753

Merged
merged 82 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
3dd06ee
Adds .devcontainer
kenorb Aug 2, 2022
6ee2308
Adds additional vscode C++ extensions
kenorb Aug 2, 2022
88ffea4
Converts tabs into spaces in devcontainer.json
kenorb Aug 2, 2022
ea47c03
devcontainer: Adds vscode Vim extension
kenorb Aug 2, 2022
d0b8d22
Moves Indicator and IndicatorBase into Indicator/
kenorb Aug 7, 2022
b37f79b
Adds .clang-tidy
kenorb Aug 15, 2022
72699d9
Adds clang-format pre-commit hook
kenorb Aug 15, 2022
a8ddd3b
Adds clang-format pre-commit hook
kenorb Aug 15, 2022
5287625
WIP. Writing stubs/most important methods' implementations for Emscri…
nseam Nov 17, 2022
d393683
WIP. Added missing C++ methods regarding String printing/manipulation…
nseam Nov 30, 2022
e36c9c9
WIP. Trying to run emscripten-generated code in the browser.
nseam Dec 1, 2022
42409e3
WIP. Trying to make smart pointers to work in JS.
nseam Dec 15, 2022
da13c54
WIP. Making Account and Exchange classes to work via Emscripten. Also…
nseam Dec 21, 2022
ff982e3
WIP. End up with include loop.
nseam Jan 9, 2023
36993ce
WIP. Fixing Emscripten compilation errors.
nseam Jan 12, 2023
efa69da
WIP. Fixing Emscripten compilation errors.
nseam Jan 14, 2023
db0b8a0
WIP. Making code C++/Emscripten-compatible.
nseam Jan 19, 2023
f4c5d18
WIP. Code is now compiling for a FX31337-wasm's tests/js/TestRunner.js
nseam Jan 20, 2023
c09b514
IndicatorsTest now compiles in MT5. Need to check other tests.
nseam Jan 26, 2023
88108ce
WIP. Fixing MT5 tests.
nseam Jan 27, 2023
17cd38a
Fixed C++ and MQL5 errors for tests in /tests folder.
nseam Feb 2, 2023
a30a476
WIP. Trying to make tests to run on MT4.
nseam Feb 7, 2023
720ec62
WIP. Should fix tests in MT4 and MT5.
nseam Feb 8, 2023
032e8e7
WIP. Should fix errors in MT4, MT5 & C++ for TaskRunner.
nseam Feb 9, 2023
11b6ce5
Added missing includes.
nseam Feb 16, 2023
f78b9fd
Addes required flags for emcc and gcc.
nseam Feb 16, 2023
a13a079
Made tests to continue even if one of them fails.
nseam Feb 17, 2023
2a5f72c
Added ToString() override to Indicator class, so IndicatorsTest will …
nseam Feb 17, 2023
a36e135
WIP. Making FX's Indicator.cpp's to compile.
nseam Feb 17, 2023
ba94fa8
Sets job max-parallel to 4 as per API limits
kenorb Feb 21, 2023
ccade19
WIP. Using Indi_TickProvider to provide tick for Candle indicator and…
nseam Feb 23, 2023
ee07184
Merge branch 'dev-fx-emcc' of https://github.com/nseam/EA31337-classe…
nseam Feb 23, 2023
16ebdc4
Fixing MQL4 errors.
nseam Feb 24, 2023
65b8f29
WIP. Fixing MT4 errors.
nseam Feb 25, 2023
478b640
WIP. Testing RSI over IndicatorTfDummy over Indi_TickProvider. Now we…
nseam Mar 1, 2023
30d6f7f
WIP. Testing RSI over IndicatorTfDummy over Indi_TickProvider. RSI re…
nseam Mar 2, 2023
db3442d
Fixes recent syntax errors for C++.
nseam Mar 8, 2023
93a46bb
Little changes for array #defines.
nseam Apr 7, 2023
42de20c
WIP. Making a Tester class and exporting IndicatorTfDummy and RSI ind…
nseam Apr 20, 2023
3bc9a57
src/IndicatorTest.cpp
nseam Apr 28, 2023
050cee4
Empty commit to run tests.
nseam May 24, 2023
2d7e339
Fixes Indi_RSI #elif error. Also, added PERIOD_TF_IRREGULAR enum valu…
nseam May 24, 2023
930cda4
Fixes tests using Platform::FetchDefaultCandleIndicator() as method n…
nseam May 24, 2023
df4bb44
Tiny internal changes. Part of testing emcc API.
nseam Jun 1, 2023
b3a7f4a
Fixes warning "too many arguments for function-like macro 'RUNTIME_ER…
nseam Jun 5, 2023
69220b5
Should fix problem with MA expecting additional bar, despite it has a…
nseam Jun 8, 2023
03bcdf3
Little changes required by emcc support.
nseam Jun 8, 2023
4faba09
Merge branch 'v3.004-dev' into dev-fx-emcc
nseam Jun 13, 2023
d53d07a
Should fix problems with DrawIndicatorTest as Platform::AddWithDefaul…
nseam Jun 15, 2023
f31618f
Merge branch 'dev-fx-emcc' of https://github.com/nseam/EA31337-classe…
nseam Jun 15, 2023
b246c9d
Fixing CompileTest
nseam Jun 15, 2023
78d8634
Fixes problem with not preserving TF passed to Candle indicators.
nseam Jun 15, 2023
94d2da4
Fixes ZigZag and ZigZagColor value validation.
nseam Jun 16, 2023
e89966d
Merge pull request #665 from nseam/dev-fx-emcc
kenorb Jun 16, 2023
2fa7dd0
Merge branch 'v3.004-dev' into v3.005-dev
kenorb Jun 24, 2023
640e07c
Merge tag 'v2.012' into v3.004-dev-new
kenorb Apr 26, 2024
af7b695
Merge tag 'v2.012' into v3.004-dev-new
kenorb Apr 27, 2024
d290033
Std: Uses Alert() and DebugBreak() for MQL only
kenorb Apr 27, 2024
3b58324
Merge remote-tracking branch 'origin/v3.004-dev-cpp' into v3.008-dev-new
kenorb May 4, 2024
3a3e450
Merge remote-tracking branch 'origin/v3.004-dev-indi-rename' into v3.…
kenorb May 4, 2024
c68bbce
Merge remote-tracking branch 'origin/v3.003-dev-vscode' into v3.008-d…
kenorb May 4, 2024
ffed2e8
Merge remote-tracking branch 'origin/v3.004-dev-tasks' into v3.008-de…
kenorb May 4, 2024
e98b191
Merge remote-tracking branch 'origin/v3.004-dev-cpp2' into v3.008-dev…
kenorb May 4, 2024
9aed662
Merge remote-tracking branch 'origin/v3.004-dev-new-std-fix' into v3.…
kenorb May 4, 2024
9a9d453
Merge remote-tracking branch 'origin/v3.005-dev' into v3.008-dev-new
kenorb May 4, 2024
6859c3a
Fixed problem with casting string to ENUM_LOG_LEVEL via indicator par…
nseam May 6, 2024
36a2b12
Fixed problem with casting string to ENUM_LOG_LEVEL via indicator par…
nseam May 6, 2024
474a694
Merge pull request #751 from nseam/v3.008-dev-new-enum-log-level-casting
kenorb May 7, 2024
d8eb065
WIP. Trying to make indicators to work with historic ticks.
nseam May 22, 2024
92ee47a
WIP. Fixes In ItemsHistory and ItemsHistoryTfCandleProvider for Candl…
nseam May 22, 2024
b9173b9
Merge remote-tracking branch 'origin/v3.007-dev-new' into v3.008-dev-new
kenorb Jun 17, 2024
7187581
Fixed problem with casting string to ENUM_LOG_LEVEL via indicator par…
nseam May 6, 2024
28205be
Merge remote-tracking branch 'origin/v3.008-dev-new' into v3.008-dev-new
kenorb Jun 17, 2024
6a38ad3
Committing the ItemsHistory-related code before merging `v3.008-dev-n…
nseam Jun 26, 2024
2911097
Merge branch 'v3.008-dev-new' into v3.007-dev-new-itemshistory-fixes.…
nseam Jun 26, 2024
3228d70
Merge branch 'v3.008-dev-new' of https://github.com/EA31337/EA31337-c…
nseam Jun 26, 2024
63f1ddb
Fixes compilation errors in MT4 and MT5.
nseam Jun 27, 2024
c132e9b
Added missing files.
nseam Jun 27, 2024
2a805d1
Removed unnecessary include. Fixes LinearWeightedMAOnBuffer() call in…
nseam Jun 27, 2024
e7ba4d5
WIP. Dict now uses class instead of struct in order to prevent copyin…
nseam Jul 1, 2024
80672f1
Merge pull request #757 from nseam/v3.008-dev-new--dict-uses-class-ge…
kenorb Jul 7, 2024
eb38f88
Comments out Alert()/DebugBreak() for non-MQL
kenorb Jul 27, 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
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
Language: Cpp
BasedOnStyle: Google
ColumnLimit: 120
IndentPPDirectives: BeforeHash
108 changes: 108 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
Checks: |-
*,
-altera-id-dependent-backward-branch,
-altera-struct-pack-align,
-altera-unroll-loops,
-bugprone-branch-clone,
-bugprone-copy-constructor-init,
-bugprone-easily-swappable-parameters,
-bugprone-integer-division,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-redundant-branch-condition,
-bugprone-reserved-identifier,
-bugprone-string-constructor,
-bugprone-unhandled-self-assignment,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-msc30-c,
-cert-msc50-cpp,
-cert-oop54-cpp,
-cert-oop54-cpp,
-clang-diagnostic-error,
-concurrency-mt-unsafe,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-fuchsia-trailing-return,
-google-explicit-constructor,
-google-global-names-in-headers,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-runtime-int,
-hicpp-avoid-c-arrays,
-hicpp-braces-around-statements,
-hicpp-braces-around-statements,
-hicpp-exception-baseclass,
-hicpp-explicit-conversions,
-hicpp-member-init,
-hicpp-multiway-paths-covered,
-hicpp-named-parameter,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,,
-hicpp-special-member-functions,
-hicpp-uppercase-literal-suffix,
-hicpp-use-auto,
-hicpp-use-equals-default,
-hicpp-use-nullptr,
-hicpp-vararg,
-llvm-else-after-return,
-llvm-header-guard,,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,,
-llvmlibc-restrict-system-libc-headers,
-misc-definitions-in-headers,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
-misc-unconventional-assign-operator,
-misc-unused-parameters,,
-modernize-avoid-c-arrays,
-modernize-raw-string-literal,
-modernize-redundant-void-arg,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-nullptr,
-modernize-use-nullptr,
-modernize-use-trailing-return-type,
-modernize-use-using,
-performance-unnecessary-value-param,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-braces-around-statements,
-readability-const-return-type,
-readability-container-size-empty,
-readability-convert-member-functions-to-static,
-readability-delete-null-pointer,
-readability-else-after-return,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-redundant-declaration,
-readability-redundant-string-init,
-readability-simplify-boolean-expr,
-readability-uppercase-literal-suffix,
FormatStyle: file
HeaderFilterRegex: '.*'
WarningsAsErrors: ''
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
23 changes: 22 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{

// "build": {
// "dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
// "args": { "VARIANT": "ubuntu-22.04" }
// },

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"nicholishen.mql-over-cpp",
"vscodevim.vim",
"DavidAnson.vscode-markdownlint",
"EA31337.vscode-mql-tools"
"EA31337.vscode-mql-tools",
"xaver.clang-format"
],
}
},
Expand All @@ -23,7 +34,17 @@
// "ghcr.io/maks1ms/devcontainers-features/wine:0": {},
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"name": "EA31337"

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
}
14 changes: 7 additions & 7 deletions .github/workflows/compile-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
jobs:

FileList:
if: ${{ false }} # @fixme
outputs:
filelist: ${{ steps.get-files.outputs.filelist }}
runs-on: ubuntu-latest
Expand All @@ -30,7 +29,6 @@ jobs:
run: echo ${{ steps.get-files.outputs.filelist }}

Compile:
if: ${{ false }} # @fixme
runs-on: ubuntu-latest
needs: [FileList]
strategy:
Expand All @@ -45,9 +43,11 @@ jobs:
with:
compiler: gcc-latest
- name: Compile ${{ matrix.file }} via emcc
run: emcc "${{ matrix.file }}"
if: always()
run: >
emcc -s WASM=1 -s ENVIRONMENT=node -s EXIT_RUNTIME=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=1 -Wall -s
MODULARIZE=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 --bind -s EXPORTED_FUNCTIONS="[]" -g -std=c++17
"${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via g++
run: g++ -c "${{ matrix.file }}"
- if: failure()
# Force success.
run: exit 0
if: always()
run: g++ -g -std=c++17 -c "${{ matrix.file }}"
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
strategy:
matrix:
test:
- AccountTest
- BufferStructTest
- BufferTest
- ChartTest
Expand All @@ -59,6 +60,7 @@ jobs:
- SummaryReportTest
- TickerTest
- TradeTest
max-parallel: 4
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -72,6 +74,7 @@ jobs:
Version: 4
TestExpert: ${{ matrix.test }}
RunOnError: show_logs 200
if: always()
timeout-minutes: 10

Scripts-MQL4:
Expand Down Expand Up @@ -100,6 +103,7 @@ jobs:
- TerminalTest
- TimerTest
- ValueStorageTest
max-parallel: 4
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -108,6 +112,7 @@ jobs:
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
if: always()
timeout-minutes: 10

Scripts-MQL4-Ignore:
Expand All @@ -134,6 +139,7 @@ jobs:
with:
Script: ${{ matrix.test }}
RunOnFail: "exit 0"
if: always()
timeout-minutes: 10

Trade-Tests-MQL4:
Expand All @@ -156,6 +162,7 @@ jobs:
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
if: always()
timeout-minutes: 10

cleanup:
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
exclude: '\.md$'
repos:

# - repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v14.0.6
# hooks:
# - id: clang-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
Expand Down
1 change: 1 addition & 0 deletions 3D/Chart3DCandles.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* 3D chart candles renderer.
*/

#include "../Chart.define.h"
#include "Chart3DType.h"
#include "Cube.h"
#include "Device.h"
Expand Down
5 changes: 5 additions & 0 deletions 3D/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ struct PointEntry {
T point;
long key;

// Default constructor.
PointEntry() {}

// Copy constructor.
PointEntry(const PointEntry<T>& r) : point(r.point), key(r.key) {}

// Constructor.
PointEntry(const T& _point) {
point = _point;
key = MakeKey(_point.Position.x, _point.Position.y, _point.Position.z);
Expand Down
17 changes: 12 additions & 5 deletions 3D/Vertex.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ struct Vertex {
DXVector3 Normal;
DXColor Color;

Vertex() {
Color.r = 1.0f;
Color.g = 1.0f;
Color.b = 1.0f;
Color.a = 1.0f;
// Default constructor.
Vertex(float r = 1, float g = 1, float b = 1, float a = 1) {
Color.r = r;
Color.g = g;
Color.b = b;
Color.a = a;
}

Vertex(const Vertex &r) {
Position = r.Position;
Normal = r.Normal;
Color = r.Color;
}

static const ShaderVertexLayout Layout[3];
Expand Down
17 changes: 16 additions & 1 deletion Account/Account.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef __MQL__
// Allows the preprocessor to include a header file when it is needed.
#pragma once
#include "../Serializer.enum.h"
#include "../Serializer/Serializer.enum.h"
#endif

// Forward class declaration.
Expand All @@ -48,6 +48,21 @@ struct AccountEntry {
double margin_used;
double margin_free;
double margin_avail;

// Default constructor.
AccountEntry() {}

// Constructor.
AccountEntry(const AccountEntry& r)
: dtime(r.dtime),
balance(r.balance),
credit(r.credit),
equity(r.equity),
profit(r.profit),
margin_used(r.margin_used),
margin_free(r.margin_free),
margin_avail(r.margin_avail) {}

// Serializers.
void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {}
SerializerNodeType Serialize(Serializer& _s) {
Expand Down
3 changes: 2 additions & 1 deletion Account/AccountBase.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
#ifndef __MQL__
// Allows the preprocessor to include a header file when it is needed.
#pragma once
#include "../Serializer.enum.h"
#include "../Serializer/Serializer.enum.h"
#endif

// Forward class declaration.
class Serializer;

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

// Struct for account entries.
Expand Down
Loading
Loading