Lean icon indicating copy to clipboard operation
Lean copied to clipboard

IchimokuKinkoHyo WarmUpPeriod

Open AlexCatarino opened this issue 1 month ago • 0 comments

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

  • [x] I have completely filled out this template
  • [x] I have confirmed that this issue exists on the current master branch
  • [x] I have confirmed that this is not a duplicate issue by searching issues
  • [x] I have provided detailed steps to reproduce the issue

AlexCatarino avatar Dec 05 '25 18:12 AlexCatarino