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

Incorrect order type in API response #2

Open
gmehta693 opened this issue Dec 27, 2023 · 4 comments
Open

Incorrect order type in API response #2

gmehta693 opened this issue Dec 27, 2023 · 4 comments

Comments

@gmehta693
Copy link

We placed an SL buy order below the LTP for an option and we saw that we are receiving order type as RL in the response of get orders API. Attaching screenshort for your reference.
WhatsApp Image 2023-12-26 at 18 34 40

Order response:

{
    "status": "success",
    "orders": [
        {
            "order_id": "OEWKL00039J<",
            "exchange": "NSE_FO",
            "token": 65626,
            "order_number": "1100000106962668",
            "status": "PENDING",
            "error_reason": "",
            "transaction_type": "BUY",
            "product": "DELIVERY",
            "variety": "RL",
            "total_quantity": 500,
            "pending_quantity": 500,
            "traded_quantity": 0,
            "disclosed_quantity": 0,
            "disclosed_quantity_remaining": 0,
            "order_price": 90.00,
            "trigger_price": 0.00,
            "traded_price": 0.0,
            "validity": "DAY",
            "validity_days": 0,
            "symbol": "NIFTY",
            "series": "XX",
            "instrument_name": "",
            "expiry_date": "2023-12-28",
            "strike_price": 21500.00,
            "option_type": "PE",
            "lot_size": 50,
            "order_created_at": "2023-12-26 12:49:37",
            "initiated_by": "MOBILE-Ex",
            "modified_by": "MOBILE-Ex",
            "is_amo": false,
            "order_identifier": "app=dev_yTXpYjgu"
        }
    ],
    "metadata": {
        "total_records": 57,
        "all_records": 57,
        "completed_records": 16,
        "open_records": 1
    }
}
@hmtp140789
Copy link

This is expected behaviour. For buy SL orders Trigger price should be above LTP. Same should be happening with other brokers too.

@gmehta693
Copy link
Author

Other brokers(Zerodha) don't allow SL orders with below LTP as trigger price. The problem is in the response we are receiving RL as order type but it shows SL type in your console. Is this discrepency expected?

@prakshalgangwal
Copy link

Hemant - As Gaurav mentioned, In Zerodha and other brokers, an SL order won't go through if trigger price is lower than the LTP.

In the above issue, SL order went through with invalid price (trigger less then LTP for Buy SL order, and we used vortex APIs to place it), ideally we should be getting an error message like this in attached picture.
SL_order_error

@hmtp140789
Copy link

Yes, Other brokers are handling this in FrontEnd. But it is difficult to handle that in APIs as APIs won't have LTPs. If we do an LTP check on backend, it will add an extra step to every order placement, consequently adding to latency. So it is a question of speed vs "correctness". Here we have chosen speed.

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

3 participants