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

Issue when sending a NewOrderRequest with limit stop market order type and stop trigger #7 #7

Open
l3oxer opened this issue Mar 9, 2021 · 1 comment

Comments

@l3oxer
Copy link

l3oxer commented Mar 9, 2021

when Executing the following code
'''

        NewOrderRequest newOrderRequestStop = new NewOrderRequest("BTC-PERPETUAL", dirStop);
        
        //   newOrderRequest.Price = 45000;
        newOrderRequestStop.OrderType = OrderType.StopMarket;
        newOrderRequestStop.Quantity = 1000;
        newOrderRequestStop.Label = "Testing From the bot";
        newOrderRequestStop.StopPrice = 42000;
        newOrderRequestStop.StopTrigger = StopTrigger.LastPrice;
        OrderOperationResponse orderOperationResponseStop = await deribitApi.Send(newOrderRequestStop);
        if (!orderOperationResponseStop.Succeeded) {
            Concole.WriteLine("Error " + orderOperationResponseStop.Error.Code + " " + orderOperationResponseStop.Error.Message + " " + orderOperationResponseStop.Error.Data);
        } else {
            Concole.WriteLine((orderOperationResponse.ToString());
        }

'''

I get the following exception

image

when I remove this line

''' newOrderRequestStop.StopTrigger = StopTrigger.LastPrice;'''

everything seems fine

@l3oxer
Copy link
Author

l3oxer commented Mar 10, 2021

I think i found the source of the error

when you send a stop trigger as StopTrigger.LastPrice the response will be a string value for the property Price which will cause
a Parsing Exception

Also Untriggered does not exist as a part of the OrderStatus enum
image

@l3oxer l3oxer changed the title Issue when sending a NewOrderRequest with limit stop market order type and stop trigger Issue when sending a NewOrderRequest with limit stop market order type and stop trigger #issuenbr Mar 10, 2021
@l3oxer l3oxer changed the title Issue when sending a NewOrderRequest with limit stop market order type and stop trigger #issuenbr Issue when sending a NewOrderRequest with limit stop market order type and stop trigger #7 Mar 10, 2021
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