Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error when passing indicators which start with numbers to IndicatorFactory #53

Closed
NowBothWhiteAndRed opened this issue Nov 5, 2020 · 2 comments

Comments

@NowBothWhiteAndRed
Copy link

Hi,

Just noticing the following:

vbt.IndicatorFactory(output_names=['real'], input_names=['1d_max']).from_apply_func(lambda ts: ts).run(new_indicator)

produces: {SyntaxError}invalid syntax (factory.py, line 2)

but:

vbt.IndicatorFactory(output_names=['real'], input_names=['a_1d_max']).from_apply_func(lambda ts: ts).run(new_indicator)

works fine

Not sure if it's an issue or not but seems odd enough to note.

@polakowo
Copy link
Owner

polakowo commented Nov 5, 2020

That’s expected because it generates object properties from your input and output names, and properties as any other variables in Python cannot start with a number.

@NowBothWhiteAndRed
Copy link
Author

Got it, thanks

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

No branches or pull requests

2 participants