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

Comission value from paper trading parsed incorrect #209

Closed
BusinessDuck opened this issue Mar 4, 2024 · 3 comments
Closed

Comission value from paper trading parsed incorrect #209

BusinessDuck opened this issue Mar 4, 2024 · 3 comments
Assignees

Comments

@BusinessDuck
Copy link
Contributor

BusinessDuck commented Mar 4, 2024

Typescript typings are incorrect for OrderState, comissionCurrency incoming is 1.7976931348623157E308, this an incorrect number for javascript. Also comission value is empty.

const openOrderHandler = (orderId: Number, contract: Contract, filled: Order, state: OrderState) => {});

this.api.on(EventName.openOrder, openOrderHandler);

Incorrect typing

    /** The order's generated commission. */
    commission?: number;
    /** The execution's minimum commission. */
    minCommission?: number;
    /** The executions maximum commission. */
    maxCommission?: number;
    /** The generated commission currency. */
    commissionCurrency?: string;

Looks like a parsing problem also

@BusinessDuck
Copy link
Contributor Author

Hotfix on client side:

commission: {
    currency: opts.currency,
    value: Number(state.commissionCurrency.split('E')[0]),
},

@rylorin
Copy link
Member

rylorin commented Mar 8, 2024

Hello,
can you please provide some information about the order?
I was unable to reproduce this issue.
Thanks

@rylorin rylorin self-assigned this Jun 13, 2024
@rylorin
Copy link
Member

rylorin commented Jun 13, 2024

Probably fixed with PR #216

@rylorin rylorin closed this as completed Jun 13, 2024
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