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

Feature: Order creates OcO 2.0.6 #23

Merged
merged 7 commits into from
Jan 29, 2020

Conversation

f3rno
Copy link
Contributor

@f3rno f3rno commented Jan 22, 2020

Description:

Adds a new order type that submits an OCO order after an initial LIMIT/MARKET order fills.

Pending documentation, feature-complete

New features:

  • OCOCO

PR status:

  • Version bumped
  • Change-log updated
  • Tests added or updated
  • Documentation updated

Screenshot from 2020-01-22 13 58 16

@f3rno f3rno changed the title [WIP Docs] Feature: Order creates OcO Feature: Order creates OcO 2.0.6 Jan 29, 2020
}

if (!params.submitDelay) {
params.submitDelay = 5000
Copy link
Contributor

Choose a reason for hiding this comment

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

Why so high? Ping pongs default is only 2000:

if (!_isFinite(params.cancelDelay)) {
    params.cancelDelay = 1000
  }

  if (!_isFinite(params.submitDelay)) {
    params.submitDelay = 2000
  }

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed; copy-paste mistake, it was also accessing the wrong key for the parameter. Nice catch 🙇‍♂️

const { h = {} } = instance
const { declareEvent } = h

declareEvent(instance, host, 'self:submit_initial_order', 'submit_initial_order')
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice, didnt realize you could create custom events

}

if (!_isFinite(limitPrice)) return 'Invalid OCO limit price'
if (!_isFinite(stopPrice)) return 'Invalid OCO stop price'
Copy link
Contributor

Choose a reason for hiding this comment

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

We could also check that OCO amount < original order amount otherwise it might be rejected for insufficient balance

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 wouldn't restrict it; if the order fails due to insufficient balance it automatically cancels, and it should be up to the user.

Copy link
Contributor

@JacobPlaster JacobPlaster left a comment

Choose a reason for hiding this comment

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

Few minors

@JacobPlaster JacobPlaster merged commit 981e854 into bitfinexcom:master Jan 29, 2020
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.

None yet

2 participants