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

The default status of the order is wrong and the order cannot be processed? #185

Open
whatwoot opened this issue Mar 1, 2025 · 0 comments

Comments

@whatwoot
Copy link

whatwoot commented Mar 1, 2025

Hi, sir, I found that in L3_nopartialfillexchange.rs file, in the following code, the order.req = Status::None, which directly
causes the bussiness to be BacktestError::InvalidOrderRequest ?


fn process_recv_order_(
&mut self,
mut order: Order,
recv_timestamp: i64,
) -> Result<(), BacktestError> {
order.req = Status::None; <------------

    // Processes a new order.
    if order.req == Status::New {
        self.ack_new(&mut order, recv_timestamp)?;
    }
    // Processes a cancel order.
    else if order.req == Status::Canceled {
        self.ack_cancel(&mut order, recv_timestamp)?;
    }
    // Processes a modify order.
    else if order.req == Status::Replaced {
        self.ack_modify::<false>(&mut order, recv_timestamp)?;
    } else {
        return Err(BacktestError::InvalidOrderRequest);<-----------
    }
    // Makes the response.
    let local_recv_timestamp =
        recv_timestamp + self.order_latency.response(recv_timestamp, &order);
    self.orders_to.append(order, local_recv_timestamp);
    Ok(())
}
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

1 participant