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

Indicators refactor (part 3) #634

Merged
merged 41 commits into from
Jan 19, 2022
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6b147ae
Adds TickManager
kenorb Oct 28, 2021
95f05ac
Tick/TickManager: Adds TickManagerOverflowListener()
kenorb Oct 29, 2021
484bd82
Fixed Dicts to take into consideration overflow listeners.
nseam Nov 8, 2021
1f2902c
GHA: Adds Tick tests
kenorb Nov 8, 2021
5a9836c
Merge tag 'v2.009' into dev-tickmanager
kenorb Nov 9, 2021
3b2045d
Chart: ChartTf: Adds SecsToTf()
kenorb Oct 28, 2021
182f79f
Indi_AC: Sets 2 modes when using iCustom()
kenorb Nov 9, 2021
f60a9fc
Indicator: Moves Init() to protected section
kenorb Nov 9, 2021
c508d52
Fixes problem with non-visual mode 4086 errors due to BarsCalculated(…
nseam Nov 12, 2021
b85e815
GHA: Uses 4.0.0.1349 to run main tests
kenorb Dec 5, 2021
fee7085
GHA: Uses 4.0.0.1349 to compile main tests
kenorb Dec 5, 2021
43829c3
GHA: Removes init-platform due to hang
kenorb Dec 5, 2021
61b6c16
Merge pull request #617 from EA31337/dev-tickmanager
kenorb Dec 5, 2021
9603dc3
WIP. i*OnIndicator versions of all indicators (except MA).
nseam Dec 7, 2021
1aa8db9
Fixed Dicts to take into consideration overflow listeners.
nseam Nov 8, 2021
66d435a
Merge pull request #622 from EA31337/dev
kenorb Dec 9, 2021
a493f36
WIP. Finished i*OnIndicator mode for all indicators except MA. Change…
nseam Dec 9, 2021
f4c946d
WIP. AMA now requires refactor back to be parent of Indicator or some…
nseam Dec 11, 2021
761face
WIP. Introduces IndicatorCandleSource and IndicatorTickSource indicat…
nseam Dec 15, 2021
fea144a
WIP. Almost working AMA indicator (still varies to much with original…
nseam Dec 16, 2021
0e14527
WIP. Partially working Tick/Candle/TickOrCandle indicators differenti…
nseam Dec 22, 2021
c5be80f
WIP. Closer to the end. Now we need to find a way to feed indicator w…
nseam Dec 29, 2021
08c6062
Indi_MA: Renames InpMAPeriod to _ma_period to avoid global variable c…
kenorb Dec 29, 2021
506d08e
Indi_MA: Renames InpMAMethod to _ma_method to avoid global variable c…
kenorb Dec 29, 2021
88d0a7c
WIP. Now we need to find a way to make BufferTick to provide continuo…
nseam Dec 30, 2021
c2a87cd
AS-IS.
nseam Jan 4, 2022
435f1d1
WIP. IndicatorsTest ready for testing!
nseam Jan 5, 2022
a7f3334
Adds Indi_Custom indicator
kenorb Jan 5, 2022
c6bc378
Merge branch 'dev' of https://github.com/EA31337/EA31337-classes into…
nseam Jan 6, 2022
58f94f9
Fixed bug with IndicatorBase::GetValue() which called GetEntryValue()…
nseam Jan 7, 2022
d1c927b
EA: Adds enum's comment
kenorb Jan 8, 2022
a47681b
Merge branch 'dev-indi-custom' into dev
kenorb Jan 8, 2022
d93deb8
Improves tasks return logic
kenorb Jan 8, 2022
2640ceb
Merge branch 'dev' of https://github.com/EA31337/EA31337-classes into…
nseam Jan 12, 2022
e950493
State of the art
nseam Jan 12, 2022
078af3a
Looks like there is nothing more to do with AMA. Differences are marg…
nseam Jan 13, 2022
8e39201
Fixed order of mode and shift when calling Indicator::GetValue<T>(). …
nseam Jan 18, 2022
71108dc
Fixed typo in auxiliary indicator fetching by ID.
nseam Jan 18, 2022
a469c5e
Merge branch 'dev-indicator-refactor' of https://github.com/EA31337/E…
nseam Jan 18, 2022
6ee889c
Fixes EOL characters
kenorb Jan 18, 2022
74eb036
IndicatorsTest was set to test only AMA or Pattern indicator. Now it …
nseam Jan 19, 2022
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
Prev Previous commit
Next Next commit
Tick/TickManager: Adds TickManagerOverflowListener()
kenorb committed Oct 29, 2021
commit 95f05acf0c01a8e9aa6ceda0db33cb0b39d083f2
20 changes: 19 additions & 1 deletion Tick/TickManager.h
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ class TickManager : public BufferStruct<MqlTick> {
*/
void Init() {
AddFlags(DICT_FLAG_FILL_HOLES_UNSORTED);
SetMaxConflicts(86400);
SetOverflowListener(TickManagerOverflowListener, 10);
}

public:
@@ -73,4 +73,22 @@ class TickManager : public BufferStruct<MqlTick> {
// template <typename T>
// void Set(STRUCT_ENUM(TickManagerParams, ENUM_TSM_PARAMS_PROP) _prop, T _value)
// { params.Set<T>(_prop, _value); }

/* Other methods */

/**
* Function should return true if resize can be made, or false to overwrite current slot.
*/
static bool TickManagerOverflowListener(ENUM_DICT_OVERFLOW_REASON _reason, int _size, int _num_conflicts) {
switch (_reason) {
case DICT_OVERFLOW_REASON_FULL:
// We allow resize if dictionary size is less than 86400 slots.
return _size < 86400;
case DICT_OVERFLOW_REASON_TOO_MANY_CONFLICTS:
default:
// When there is too many conflicts, we just reject doing resize, so first conflicting slot will be reused.
break;
}
return false;
}
};