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

Config validation fails on symbols.write_when #427

Closed
noamagiv opened this issue May 21, 2024 · 0 comments · Fixed by #431
Closed

Config validation fails on symbols.write_when #427

noamagiv opened this issue May 21, 2024 · 0 comments · Fixed by #431

Comments

@noamagiv
Copy link
Contributor

I'm getting the following exception when running with the default toml settings

Traceback (most recent call last):
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 483, in validate
nvalue = Schema(
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 518, in validate
raise SchemaWrongKeyError(message, e.format(data) if e else None)
schema.SchemaWrongKeyError: Wrong key 'write_when' in {'delta': 0.5, 'strike_limit': 1000.0, 'write_threshold': 0.01, 'write_when': {'green': False, 'red': True}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 483, in validate
nvalue = Schema(
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 489, in validate
raise SchemaError(
schema.SchemaError: Key 'puts' error:
Wrong key 'write_when' in {'delta': 0.5, 'strike_limit': 1000.0, 'write_threshold': 0.01, 'write_when': {'green': False, 'red': True}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 483, in validate
nvalue = Schema(
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 489, in validate
raise SchemaError(
schema.SchemaError: Key 'QQQ' error:
Key 'puts' error:
Wrong key 'write_when' in {'delta': 0.5, 'strike_limit': 1000.0, 'write_threshold': 0.01, 'write_when': {'green': False, 'red': True}}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "", line 1, in
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/click/core.py", line 1157, in call
return self.main(*args, **kwargs)
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, **kwargs)
File "/home/noam/dev/thetagang/thetagang/main.py", line 41, in cli
start(config, without_ibc)
File "/home/noam/dev/thetagang/thetagang/thetagang.py", line 36, in start
validate_config(config)
File "/home/noam/dev/thetagang/thetagang/config.py", line 254, in validate_config
schema.validate(config) # type: ignore
File "/home/noam/.cache/pypoetry/virtualenvs/thetagang-PBDHhFlu-py3.10/lib/python3.10/site-packages/schema.py", line 489, in validate
raise SchemaError(
schema.SchemaError: Key 'symbols' error:
Key 'QQQ' error:
Key 'puts' error:
Wrong key 'write_when' in {'delta': 0.5, 'strike_limit': 1000.0, 'write_threshold': 0.01, 'write_when': {'green': False, 'red': True}}

brndnmtthws added a commit that referenced this issue May 21, 2024
The per-symbol write_when config schema was invalid.

This resolves #427.
brndnmtthws added a commit that referenced this issue May 21, 2024
The per-symbol write_when config schema was invalid.

This resolves #427.
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

Successfully merging a pull request may close this issue.

1 participant