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

Incorrect MACD WarmUpPeriod & ComputeNextValue #5109

Closed
4 tasks done
DerekMelchin opened this issue Jan 1, 2021 · 0 comments · Fixed by #5110
Closed
4 tasks done

Incorrect MACD WarmUpPeriod & ComputeNextValue #5109

DerekMelchin opened this issue Jan 1, 2021 · 0 comments · Fixed by #5110

Comments

@DerekMelchin
Copy link
Collaborator

Expected Behavior

Regarding the MovingAverageConvergenceDivergence indicator:
(1) The WarmUpPeriod is set to
max(fastPeriod, slowPeriod) + signalPeriod

(2) The Signal is only updated when Fast and Slow are ready.

(3) The Histogram is only updated when Signal.IsReady

Actual Behavior

The three conditions above are not true. See this related thread.

Potential Solution

(1) Change line 83 to
Math.Max(fastPeriod, slowPeriod) + signalPeriod

(2 & 3) Add IsReady guards before updating Signal and Histogram.

Reproducing the Problem

Run this backtest in the cloud. The logs show the MACD indicator IsReady when the internal Fast and Slow indicators are not ready.

System Information

Windows 10. Run in QC Cloud.

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant