Navigation

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

    Unable to place stop loss order

    NodeJS SDK
    4
    14
    106
    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.
    • A
      admin @bhushan last edited by

      Hi @bhushan please post your error here also check your stoploss and price.

      B 1 Reply Last reply Reply Quote 0
      • B
        bhushan @admin last edited by bhushan

        @admin not getting any errors. I tried with multiple combination but unable to place stop loss order. Limit orders are fine. And I am unable to find trigger price also in orderparams.

        When I was checking this market was at 358 range and I wanted to buy if the price moves above 362. I know I can place a limit order if the price matches my price, but I want to keep the order ready with trigger price.

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

          Hi @bhushan we will get back to you on your issue it is noted.

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

            hi @bhushan provide us with your client to further assist you.

            B 1 Reply Last reply Reply Quote 0
            • B
              bhushan @admin last edited by

              @admin Appreciate your reply but I solved it by myself.

              I made the following changes in source code and rebuilt the jar.

              • in OrderParams.java I added the parameter triggerprice
                public String triggerprice;

              -in SmartConnect.java I added the trigger price in JSONObject params which will be sent via order post request
              if (orderParams.triggerprice != null)
              params.put("triggerprice", orderParams.triggerprice);

              • in Constants.java there was no option to set order type "STOPLOSS_LIMIT" and variety "STOPLOSS" so I am using them as direct string in my program.

              Now I am able to place stoploss order and I can also use triggerprice along with the order

              V T 2 Replies Last reply Reply Quote 0
              • V
                vvbchandrasekhar @bhushan last edited by

                @bhushan
                Thanks for the workaround!

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

                  HI @vvbchandrasekhar @bhushan The above issue is solved you can check now and try to execute order.

                  T V 2 Replies Last reply Reply Quote 0
                  • T
                    theVishal @bhushan last edited by

                    This post is deleted!
                    1 Reply Last reply Reply Quote 0
                    • T
                      theVishal @admin last edited by

                      @admin Hello admin,

                      Please update the JAVA jar file to include trigger price while placing an order.

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

                        Hi @theVishal we have noted this we will update you on this.

                        1 Reply Last reply Reply Quote 0
                        • V
                          vvbchandrasekhar @admin last edited by

                          @admin said in Unable to place stop loss order:

                          HI @vvbchandrasekhar @bhushan The above issue is solved you can check now and try to execute order.

                          thanks. ichecked the changelog on https://github.com/angelbroking-github/smartapi-java/commit/8edfe8819c92aeb770de473a27a26362d1812b45

                          However, can you release the change to dist (jar file)?

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

                            Hi @vvbchandrasekhar ok.

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

                              @bhushan said in Unable to place stop loss order:

                              Hi,
                              I am unable to place stop loss order, can someone please help ? Below is the order parameters I am trying with -
                              OrderParams orderParams = new OrderParams();
                              orderParams.variety = "STOPLOSS";
                              orderParams.quantity = 1;
                              orderParams.symboltoken = "3045";
                              orderParams.exchange = Constants.EXCHANGE_NSE;
                              orderParams.ordertype = Constants.ORDER_TYPE_SL;
                              orderParams.stoploss = "362";
                              orderParams.tradingsymbol = "SBIN-EQ";
                              orderParams.producttype = Constants.PRODUCT_INTRADAY;
                              orderParams.duration = Constants.VALIDITY_DAY;
                              orderParams.transactiontype = Constants.TRANSACTION_TYPE_BUY;
                              orderParams.price = (double) 362;
                              orderParams.squareoff = "0";

                              Hi @bhushan @theVishal @vvbchandrasekhar this is updated you can check and revert back.

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