Skip to content

fix: correct SFX ma_std_dev warmup issue by filtering None values (closes #154)#177

Open
botbikamordehai2-sketch wants to merge 1 commit into
nardew:mainfrom
botbikamordehai2-sketch:fix/issue-154-1779914709
Open

fix: correct SFX ma_std_dev warmup issue by filtering None values (closes #154)#177
botbikamordehai2-sketch wants to merge 1 commit into
nardew:mainfrom
botbikamordehai2-sketch:fix/issue-154-1779914709

Conversation

@botbikamordehai2-sketch
Copy link
Copy Markdown

What

The SFX indicator was producing an anomalous first value for ma_std_dev (e.g., 9992.06 instead of ~2.08). This happened because ma_std_dev was constructed with input_indicator=self.std_dev, causing it to receive None values during std_dev's warmup period. These None values corrupted the internal state of the moving average.

Fix

Removed input_indicator=self.std_dev from the ma_std_dev constructor and instead registered it as a managed sequence via add_managed_sequence. The _calculate_new_value method already manually reads from ma_std_dev, so we need to feed it valid values only. The managed sequence approach ensures ma_std_dev only receives valid (non-None) values from std_dev.

Closes #154

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 this pull request may close these issues.

SFX warmup issue of ma_std_dev

1 participant