Skip to content

Docs: pass indicator 'resolution' by keyword — positional lands in MovingAverageType #2731

Description

@Martin-Molinero

Gap. Indicator helpers put a MovingAverageType before resolution: atr(symbol, period, type=MovingAverageType.SIMPLE, resolution=None, …) and rsi(symbol, period, moving_average_type=MovingAverageType.WILDERS, resolution=None, …). Code like self.atr(symbol, 14, Resolution.DAILY) puts the resolution in the moving-average-type slot, and pythonnet raises "argument 3 ('type') expected MovingAverageType, got Resolution". The docs examples pass arguments in the right order but never warn about this.

Evidence (Sep 24–29). In a sample of 33 "method does not exist" errors (160 errors from 139 users in total), 7 were this pattern (atr, rsi, vwap).

Proposed change. Add to skill-templates/indicators/SKILL.md (Common Mistakes) and the indicator helper-method docs (03 Writing Algorithms/28 Indicators):

Pass resolution by keyword. Many helpers take a MovingAverageType (or another optional parameter) before resolution.

self._atr = self.atr(symbol, 14, resolution=Resolution.DAILY)
self._rsi = self.rsi(symbol, 14, resolution=Resolution.DAILY)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions