Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Buy Limit orders with trigger

    Python SDK
    6
    10
    156
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rahulmungse last edited by

      Hi Team,

      I am looking for way to place Buy limit order using python.

      Scenario :- ABC is trading at 100 and i want to buy only after it
      crosses 105 and then my target is 110 with stop loss of 103.

      In a current situation if i place limit order and stock is trading below my price it execute order right away(which i dont want). Order should only execute at my price not below or after that.

      Can you help me on this?

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @rahulmungse last edited by

        Hi @builder35 can you post your values which you are passing to hit limit orders.

        R 1 Reply Last reply Reply Quote 0
        • R
          rahulmungse @admin last edited by rahulmungse

          @admin Below was the order parameters. When i place this order symbol was trading at 93 and my order got executed at 94. But i was set to buy only when it is at 95.

                      {
                      "variety": "NORMAL",
                      "tradingsymbol": "BAJFINANCE25MAR215500CE",
                      "symboltoken": "52414",
                      "transactiontype": "BUY",
                      "exchange": "NFO",
                      "ordertype": "LIMIT",
                      "price": "95",
                      "producttype": "INTRADAY",
                      "duration": "DAY",
                      "quantity": "250"
                      }
          
          R M 2 Replies Last reply Reply Quote 0
          • R
            rahul4019 @rahulmungse last edited by

            @builder35 you have to use STOPLOSS_LIMIT order instead of LIMIT order.
            user TRIGGER PRICE as 105 and LIMIT say 120..

            1 Reply Last reply Reply Quote 0
            • M
              MyAgent @rahulmungse last edited by MyAgent

              @builder35 Just add one more parameter as 'triggerprice'. By this it determines at what price order needs to be triggered. In price keep value as 0 in case you want to buy at Market Price after trigger, or any (95 in your case) desired value to buy at.

              Your JSON will look something like this:

              {
                 "variety":"NORMAL",
                 "tradingsymbol":"BAJFINANCE25MAR215500CE",
                 "symboltoken":"52414",
                 "transactiontype":"BUY",
                 "exchange":"NFO",
                 "ordertype":"LIMIT",
                 "price":"95",
                 "triggerprice":"95",
                 "producttype":"INTRADAY",
                 "duration":"DAY",
                 "quantity":"250"
              }
              

              Let me know in case of any confusion.

              J 1 Reply Last reply Reply Quote 0
              • J
                jiwan1986 @MyAgent last edited by

                @jax248 I don't think so this would work. Because we place LIMIT orders when you want to buy something at a price lower than the current market price.

                M 1 Reply Last reply Reply Quote 0
                • M
                  MyAgent @jiwan1986 last edited by

                  @rjbanna Just checked the JSON I am sending agree that my solution won't work 🙂

                  1 Reply Last reply Reply Quote 0
                  • R
                    ronak last edited by

                    Do we have a final solution for this? I want to buy with LIMIT but looks like its buying at market price instead. How to set a lower buy limit ?

                    my code: "{\n"exchange":"NSE",\n"symboltoken":1660,\n"tradingsymbol":"ITC-EQ",\n"duration":"DAY",\n"quantity":1,\n"disclosedquantity":1,\n"triggerprice":200,\n"transactiontype":"BUY",\n"ordertype":"LIMIT",\n"variety":"NORMAL",\n"producttype":"DELIVERY"\n}"

                    A 2 Replies Last reply Reply Quote 0
                    • A
                      admin @ronak last edited by

                      HI @ronak will test it from our side and update you.

                      1 Reply Last reply Reply Quote 0
                      • A
                        admin @ronak last edited by admin

                        HI @ronak Please go through the doc
                        https://smartapi.angelbroking.com/docs/Orders
                        https://www.angelbroking.com/knowledge-center/intraday-trading/stock-market-order-types

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post