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

Refactor handling of red/green for new contracts #412

Merged
merged 1 commit into from
May 6, 2024

Conversation

brndnmtthws
Copy link
Owner

@brndnmtthws brndnmtthws commented May 6, 2024

Previously, the behaviour of write_when.calls.green and write_when.puts.red was such that each option was treated as "only write when red/green", but this was confusing and had a bug.

Now, there are separate red/green options for both puts and calls, and they can be set per-symbol. Now there are (with default values):

  • write_when.puts.red=true and write_when.puts.green=false
  • write_when.calls.green=true and write_when.calls.red=false

You can also specify these on a per-symbol basis with symbols.<symbol>.<right>.write_when.(green|red).

Refer to thetagang.toml for details.

If you had previously used the default config, or didn't specify these values, then the behaviour should remain unchanged. You may want to verify your settings. You can keep the default behaviour with:

  [write_when.calls]
  # Optionally, only write calls when the underlying is green
  green = true
  red   = false

  [write_when.puts]
  # Optionally, only write puts when the underlying is red
  green = false
  red   = true

Thetagang will still respect the setting for write thresholds.

This resolves #410.

Previously, the behaviour of `write_when.calls.green` and
`write_when.puts.red` was such that each option was treated as "only
write when red/green", but this was confusing and had a bug.

Now, there are separate red/green options for both puts and calls, and
they can be set per-symbol. Now there are (with default values):

 * `write_when.puts.red=true` and `write_when.puts.green=false`
 * `write_when.calls.green=true` and `write_when.calls.red=false`

You can also specify these on a per-symbol basis with
`symbols.<symbol>.<right>.write_when.(green|red)`.

Refer to thetagang.toml for details.

If you had previously used the default config, or didn't specify these
values, then the behaviour should remain unchanged. You may want to
verify your settings. You can keep the default behaviour with:

  [write_when.calls]
  # Optionally, only write calls when the underlying is green
  green = true
  red   = false

  [write_when.puts]
  # Optionally, only write puts when the underlying is red
  green = false
  red   = true

Thetagang will still respect the setting for write thresholds.

This resolves #410.
@brndnmtthws brndnmtthws merged commit edd99d1 into main May 6, 2024
8 checks passed
@brndnmtthws brndnmtthws deleted the fix-write-when-fail branch May 6, 2024 18:34
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 this pull request may close these issues.

Write calls when underlying is not green
1 participant