Skip to content

Commit 9d7aa69

Browse files
authored
Merge pull request #2527 from Ruuudy1/feature-alternative-equity-ichimoku-cloud
Add manual indicator alternative for equity-ichimoku-cloud
2 parents ea42781 + a873dcf commit 9d7aa69

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

  • project-templates
    • csharp/equity-ichimoku-cloud
    • python/equity-ichimoku-cloud

project-templates/csharp/equity-ichimoku-cloud/Main.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ public override void Initialize()
7373
_qqq = AddEquity("QQQ").Symbol;
7474
// Add the IchimokuKinkoHyo indicator.
7575
_ichimoku = ICHIMOKU(_qqq, 9, 26, 52, 26, 26, 52, Resolution.Daily);
76+
// Alternatively, use a manual indicator.
77+
// _ichimoku = new IchimokuKinkoHyo(9, 26, 52, 26, 26, 52);
78+
// RegisterIndicator(_qqq, _ichimoku, Resolution.Daily);
7679
// Manual warm-up: need WarmUpPeriod + 1 so both .Current and .Previous are valid.
7780
IndicatorHistory(_ichimoku, _qqq, _ichimoku.WarmUpPeriod + 1, Resolution.Daily);
78-
// Plot all five Ichimoku components Tenkan, Kijun, Senkou A, Senkou B, Chikou.
81+
// Plot all five Ichimoku components - Tenkan, Kijun, Senkou A, Senkou B, Chikou.
7982
PlotIndicator("Ichimoku", _ichimoku.Tenkan, _ichimoku.Kijun, _ichimoku.SenkouA, _ichimoku.SenkouB, _ichimoku.Chikou);
8083
// Add a Scheduled Event to scan for trades every trading day at 8 AM.
8184
Schedule.On(DateRules.EveryDay(_qqq), TimeRules.At(8, 0), Rebalance);

project-templates/python/equity-ichimoku-cloud/main.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ def initialize(self) -> None:
1111
self._qqq = self.add_equity("QQQ")
1212
# Add the IchimokuKinkoHyo indicator.
1313
self._ichimoku = self.ichimoku(self._qqq, 9, 26, 52, 26, 26, 52, Resolution.DAILY)
14+
# Alternatively, use a manual indicator.
15+
# self._ichimoku = IchimokuKinkoHyo(9, 26, 52, 26, 26, 52)
16+
# self.register_indicator(self._qqq, self._ichimoku, Resolution.DAILY)
1417
# Manual warm-up: need warm_up_period + 1 so both .current and .previous are valid.
1518
self.indicator_history(self._ichimoku, self._qqq, self._ichimoku.warm_up_period + 1, Resolution.DAILY)
16-
# Plot all five Ichimoku components Tenkan, Kijun, Senkou A, Senkou B, Chikou.
19+
# Plot all five Ichimoku components - Tenkan, Kijun, Senkou A, Senkou B, Chikou.
1720
self.plot_indicator(
1821
"Ichimoku",
1922
self._ichimoku.tenkan,

0 commit comments

Comments
 (0)