Skip to content

Commit

Permalink
Merge tag 'v2.012' into v3.004-dev-new
Browse files Browse the repository at this point in the history
* tag 'v2.012': (84 commits)
  EA: Sets trade params across all strategies
  EA/Strategy/Trade: Adds AddTaskObject()
  EA/Strategy/Trade: AddTask: Fixes code syntax to avoid issues with invalid pointers
  Trade: TradeParams: Sets log_level in struct constructor
  Trade: Disables filling modes for MQL4
  EA/Strategy: Improves trading logic
  EA: Fixes recent issue with error during trade request
  Indicator: Fixes timeframe assignment in class constructor
  EA/Strategy: More fixes for log printing based on the level
  EA/Strategy: Fixes log printing based on the level
  Strategy/Trade: Adds log level getters/setters
  Trade/Strategy: Improves logic on detecting defined spread limits
  Trade: TradeParams: Adds max_spread
  Trade: Checks spread limits
  Fixes spread/deviation limit logic
  IndicatorData: Adds setter for IndicatorDataParams struct
  Exchange: Uses AccountBase instead of AccountMt
  Account/AccountMt: Fixes zero division
  Account: Renames Account to AccountMt
  Exchange: Expands test
  ...
  • Loading branch information
kenorb committed Apr 27, 2024
2 parents 5cb35fd + 4c39748 commit 5e9ef87
Show file tree
Hide file tree
Showing 138 changed files with 4,495 additions and 2,039 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/compile-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@ jobs:
run: emcc "${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via g++
run: g++ -c "${{ matrix.file }}"
- if: failure()
# Force success.
run: exit 0
1 change: 1 addition & 0 deletions .github/workflows/test-account.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
test:
- Account.test
- AccountForex.test
- AccountMt.test
steps:
- uses: actions/download-artifact@v2
with:
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/test-storage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: Test Storage

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

jobs:

compile:
name: Compile
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Exchange
skip_cleanup: true

Storage-Tests-MQL4:
defaults:
run:
shell: bash
working-directory: Storage/tests
if: false
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Collection.test
steps:
- uses: actions/download-artifact@v2
with:
name: files-ex4
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
52 changes: 52 additions & 0 deletions .github/workflows/test-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Test Task

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

jobs:

compile:
name: Compile
uses: ./.github/workflows/compile.yml
with:
artifact_prefix: mt
path: Exchange
skip_cleanup: true

Task-Tests-MQL4:
defaults:
run:
shell: bash
working-directory: Task/tests
if: false
needs: compile
runs-on: ubuntu-latest
strategy:
matrix:
test:
- Task.test
- TaskAction.test
- TaskCondition.test
- TaskGetter.test
- TaskManager.test
- TaskObject.test
- TaskSetter.test
- Taskable.car.test
- Taskable.test
steps:
- uses: actions/download-artifact@v2
with:
name: files-ex4
- name: Run ${{ matrix.test }}
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
2 changes: 2 additions & 0 deletions .github/workflows/test-trade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ on:
pull_request:
paths:
- 'Trade/**.h'
- 'Trade/**.mq?'
- '.github/workflows/test-trade.yml'
push:
paths:
- 'Trade/**.h'
- 'Trade/**.mq?'
- '.github/workflows/test-trade.yml'

jobs:
Expand Down
12 changes: 6 additions & 6 deletions 3D/Math.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ struct DXQuaternion {
//| DViewport |
//+------------------------------------------------------------------+
struct DViewport {
ulong x;
ulong y;
ulong width;
ulong height;
unsigned long x;
unsigned long y;
unsigned long width;
unsigned long height;
float minz;
float maxz;
};
Expand Down Expand Up @@ -2336,7 +2336,7 @@ float DXSHDot(int order, const float &a[], const float &b[]) {
//+------------------------------------------------------------------+
//| weightedcapintegrale |
//+------------------------------------------------------------------+
void weightedcapintegrale(float &out[], uint order, float angle) {
void weightedcapintegrale(float &out[], unsigned int order, float angle) {
float coeff[3];
coeff[0] = (float)cos(angle);

Expand Down Expand Up @@ -3031,7 +3031,7 @@ void DXSHMultiply4(float &out[], const float &a[], const float &b[]) {
//+------------------------------------------------------------------+
//| rotate_X |
//+------------------------------------------------------------------+
void rotate_X(float &out[], uint order, float a, float &in[]) {
void rotate_X(float &out[], unsigned int order, float a, float &in[]) {
out[0] = in[0];
out[1] = a * in[2];
out[2] = -a * in[1];
Expand Down
1 change: 1 addition & 0 deletions Account/Account.extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

// Includes.
#include "../String.extern.h"
#include "Account.enum.h"

// Define external global functions.
Expand Down
2 changes: 1 addition & 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.enum.h"
#endif

// Forward class declaration.
Expand Down
5 changes: 5 additions & 0 deletions Account/AccountBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ class AccountBase {
*/
AccountBase() { Init(); }

/**
* Class constructor.
*/
AccountBase(AccountBase &_account) { THIS_REF = _account; }

/**
* Class deconstructor.
*/
Expand Down
2 changes: 1 addition & 1 deletion Account/AccountBase.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.enum.h"
#endif

// Forward class declaration.
Expand Down
Loading

0 comments on commit 5e9ef87

Please sign in to comment.