Skip to content

IchimokuKinkoHyo WarmUpPeriod #9112

@AlexCatarino

Description

@AlexCatarino

Expected Behavior

All values are non-zero when ready.

Actual Behavior

SenkouB is zero when ready.

Potential Solution

Probably adding 1 to

WarmUpPeriod = 1 + Math.Max(WarmUpPeriod, senkouBPeriod + senkouBDelayPeriod);

is enough to address the issue.

Reproducing the Problem

# region imports
from AlgorithmImports import *
# endregion
class MyAlgo(QCAlgorithm):
    def initialize(self):
        self.add_equity('SPY', Resolution.DAILY).symbol
        self.hyo = IchimokuKinkoHyo(9, 26, 17, 52, 26, 26)
    def on_data(self, slice):
        bar = slice.bars.get('SPY')
        if not bar:
            return
        if self.hyo.update(bar):
            self.plot('IchimokuKinkoHyo', 'senkou_b', self.hyo.senkou_b.current.value)
            self.plot('IchimokuKinkoHyo', 'senkou_a', self.hyo.senkou_a.current.value)
Image

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions