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

Fix NR Adjustments #591

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

jsphon
Copy link
Contributor

@jsphon jsphon commented May 26, 2022

This is just a preliminary PR for the time being.

1 Implementing the alternative way of adjusting place markets.
2 If LAY limit orders have persistence type MARKET_ON_CLOSE, the remaining portion are convert to MARKET_ON_CLOSE orders.

Will the simulated profit on bets from (2) be calculated correctly if there is both a partial fill before the NR adjustment, a remaining portion converted to MARKET_ON_CLOSE?

@liampauling
Copy link
Member

Do you have any example pnl screenshots of place markets where a NR has occurred?

@jsphon
Copy link
Contributor Author

jsphon commented Jun 6, 2022

Will this do?

image

@liampauling
Copy link
Member

Has this been implemented?

Other differences of 'Place' markets:
All reduction factors will be applied (2.5% or less included)
Only if the reduction factor for a withdrawn horse is 4.0% or greater, all unmatched lay bets will be cancelled.

Only if the reduction factor for a withdrawn horse is 4.0% or greater, all unmatched lay bets will be cancelled.
@jsphon
Copy link
Contributor Author

jsphon commented Jul 5, 2022

Has this been implemented?

Other differences of 'Place' markets:
All reduction factors will be applied (2.5% or less included)
Only if the reduction factor for a withdrawn horse is 4.0% or greater, all unmatched lay bets will be cancelled.

Good point. I didn't notice that bit. I've pushed change to address that.

)

if order.side == "LAY":
if (
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already handle this on line 117?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so.

On line 174, the Order Type will be LIMIT_ON_CLOSE or LIMIT if the order's a LAY.

On line 117, the Order Type is MARKET_ON_CLOSE for LAY bets.

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.

2 participants