Navigation

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

    connect.placeOrder returns error

    C#/.Net SDK
    3
    8
    58
    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
      redmouseindia last edited by

      I tried to place order using c# library but got
      internal error code: AB2001, status: false, data: null.

      below is my code:

              OrderInfo sord = new OrderInfo();
      
              sord.variety = Constants.VARIETY_NORMAL;
              sord.tradingsymbol = "NIFTY08JUL2115900CE";
              sord.symboltoken = "39504";
              sord.transactiontype = Constants.TRANSACTION_TYPE_BUY;
              sord.exchange = Constants.EXCHANGE_NFO;
              sord.ordertype = Constants.ORDER_TYPE_MARKET;
              sord.producttype = Constants.PRODUCT_TYPE_CARRYFORWARD;
              sord.duration = Constants.VALIDITY_DAY;
              sord.price = "0";
              sord.squareoff = "0";
              sord.stoploss = "0";
              sord.quantity = "1";
      
             obj = connect.placeOrder(sord);
              OrderResponse sOres = obj.PlaceOrderResponse;
      

      please correct me if anything wrong

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

        HI @redmouseindia At what price you want to execute this order.

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

          @admin Its a market order, so i have mentioned price as ZERO

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

            @redmouseindia
            Fixed.

            Modified code as mentioned below:
            orderid and triggerprice properties of OrderInfo class returns NULL, So I created a new class named PlaceOrderInfo class removing orderid, triggerprice, stoploss and squareoff properties. Also I have mentioned Quantity as 75 instead of 1.

            Thank you.

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

              HI @redmouseindia ok.

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

                @redmouseindia

                Are you calling angel api / sdk in C# Console application OR Web application?

                R 1 Reply Last reply Reply Quote 0
                • R
                  redmouseindia @asksameer last edited by

                  @asksameer I am calling sdk in c# desktop application (UWP App)

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

                    @redmouseindia
                    Ok Thanks buddy

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