Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. divakar620
    D
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    divakar620

    @divakar620

    0
    Reputation
    8
    Posts
    1
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    divakar620 Follow

    Best posts made by divakar620

    This user hasn't posted anything yet.

    Latest posts made by divakar620

    • RE: AB1018 : Failed to get symbol details

      @admin

      Is that update sdk is taking new build from git? if yes, i did same, but still problem exisit.

              SmartApi connect = new SmartApi(api_key, JWTToken, RefreshToken);
      
              OutputBaseClass obj = new OutputBaseClass();
      
              //Login by client code and password
              obj = connect.GenerateSession(Client_code, Password);
              AngelToken agr = obj.TokenResponse;
      
              Console.WriteLine("------GenerateSession call output-------------");
              Console.WriteLine(JsonConvert.SerializeObject(agr));
              Console.WriteLine("----------------------------------------------");
      
              //Get Token
              obj = connect.GenerateToken();
              agr = obj.TokenResponse;
      
              Console.WriteLine("------GenerateToken call output-------------");
              Console.WriteLine(JsonConvert.SerializeObject(agr));
              Console.WriteLine("----------------------------------------------");
      
              //Get Profile
              obj = connect.GetProfile();
              GetProfileResponse gp = obj.GetProfileResponse;
      
              Console.WriteLine("------GetProfile call output-------------");
              Console.WriteLine(JsonConvert.SerializeObject(gp));
              Console.WriteLine("----------------------------------------------");
      
              OrderInfo ord = new OrderInfo();
              ord.variety = AngelBroking.Constants.VARIETY_NORMAL;
              ord.tradingsymbol = "NIFTY11NOV2118100CE";
              ord.symboltoken = "50055";
      
              ord.transactiontype = AngelBroking.Constants.TRANSACTION_TYPE_BUY;
      
              ord.exchange = AngelBroking.Constants.EXCHANGE_NFO;
              ord.ordertype = AngelBroking.Constants.ORDER_TYPE_MARKET;
              ord.producttype = AngelBroking.Constants.PRODUCT_TYPE_CARRYFORWARD;
              ord.duration = AngelBroking.Constants.VALIDITY_DAY.ToString();
              ord.quantity = 50.ToString();
      
              obj = connect.placeOrder(ord);
              OrderResponse Ores = obj.PlaceOrderResponse;
              //LogOut
              obj = connect.LogOut(Client_code);
              LogOutResponse lg = obj.LogOutResponse;
      
              Console.WriteLine("------LogOut call output-------------");
              Console.WriteLine(JsonConvert.SerializeObject(lg));
              Console.WriteLine("----------------------------------------------");
      

      I am gettiung below response.
      {"status":false,"message":"Internal Error","errorcode":"AB2001","data":null}

      Please clarify me, as i am spending decernt time to build algos using Angel, but you API or WebSocket not upto the level of my expectation, i am not sure, whether as i doing wrong or, it your API fault.

      posted in C#/.Net SDK
      D
      divakar620
    • WebSocket Not returning any quote info

      @admin ,

      I am using below c# code, seems websocket is not working at all.. please find below code,

              SmartApi connect = new SmartApi(api_key, JWTToken, RefreshToken);
      
              OutputBaseClass obj = new OutputBaseClass();
              wholeData = new List<DataModel>();
              //Login by client code and password
              obj = connect.GenerateSession(Client_code, Password);
              AngelToken sagr = obj.TokenResponse;
      
              //Get Token
              obj = connect.GenerateToken();
              sagr = obj.TokenResponse;
      
              WebSocket _WS = new WebSocket();
              var exitEvent = new ManualResetEvent(false);
      
              _WS.ConnectforStockQuote(sagr.feedToken, Client_code);
              if (_WS.IsConnected())
              {
                  obj = connect.getPosition();
                  GetPositionResponse position = obj.GetPositionResponse;
                  string script = "";
                  foreach (PositionData p in position.data)
                  {
                      wholeData.Add(new DataModel
                      {
                          Token = p.symboltoken,
                          Qty = p.sellqty + p.buyqty,
                          scrip = p.tradingsymbol,
                          Price = "0"
                      });
                      script = script+ "nse_fo|" + p.symboltoken + "&";
      
                  }
                 // script = nse_fo | 50068 & nse_fo | 50058 &
                 _WS.RunScript(sagr.feedToken, Client_code, script, "mw");
                  _WS.MessageReceived += WriteResult;
        
              }
              exitEvent.WaitOne();
          }
          static void WriteResult(object sender, MessageEventArgs e)
          {
              Console.WriteLine("Tick Received : " + e.Message);
          }
      

      Note: i took updated sdk few minutes back.

      065b3a2c-fb2a-4891-960a-5d1a5ae22e16-AngelWebsocket_Fail.JPG

      posted in C#/.Net SDK
      D
      divakar620
    • RE: Websocket Streaming Code for C# web application

      @admin I too have similar problem, not receiving proper data, just receiving Datetime and value, tick information was not there.. I am using same code which you share us .

      script : nse_fo|43141 => for NIFTY03NOV2117000PE

      static void WriteResult(object sender, MessageEventArgs e)
      {
      Console.WriteLine("Tick Received : " + e.Message);
      }

      All the time its printing Tick received with DateTime stamp, Is script param correct?

      posted in C#/.Net SDK
      D
      divakar620
    • RE: AB1018 : Failed to get symbol details

      @admin .. Could you please clarify ?

      posted in C#/.Net SDK
      D
      divakar620
    • RE: AB1018 : Failed to get symbol details

      @admin

      I am usign .Net. here is my Code: i don't see any wrong while comparing it with your reference..

             //Place Order
              OrderInfo ord = new OrderInfo();
              ord.variety = AngelBroking.Constants.VARIETY_NORMAL;
              ord.tradingsymbol ="NIFTY03NOV2118250CE"
              ord.symboltoken = "43477";
              ord.transactiontype = AngelBroking.Constants.TRANSACTION_TYPE_SELL;
              ord.exchange = AngelBroking.Constants.EXCHANGE_NFO;
              ord.ordertype = AngelBroking.Constants.ORDER_TYPE_MARKET;
              ord.producttype = AngelBroking.Constants.PRODUCT_TYPE_CARRYFORWARD;
              ord.duration = AngelBroking.Constants.VALIDITY_DAY.ToString();
              ord.quantity = quantity.ToString();
              obj = connect.placeOrder(ord);
              OrderResponse Ores = obj.PlaceOrderResponse;
      

      Help me to find my problem..
      Question 2
      Also, I have 2nd Question as to hold WebSocket message, do we have any model from MessageEventArgs ?

      static void WriteResult(object sender, MessageEventArgs e)
      {

              dynamic d = JsonConvert.DeserializeObject<dynamic>(e.Message);
              Console.WriteLine("Tick Received : " + e.Message);
          }
      
      posted in C#/.Net SDK
      D
      divakar620
    • RE: AB1018 : Failed to get symbol details

      @admin
      Now Getting Different Error
      Corrected Request
      {"orderid":null,"variety":"NORMAL","tradingsymbol":"NIFTY03NOV2117950PE","symboltoken":"43341","transactiontype":"SELL","exchange":"NFO","ordertype":"MARKET","producttype":"CARRYFORWARD","duration":"DAY","price":null,"squareoff":"0","stoploss":"0","quantity":"50","triggerprice":"0"}

      New Error:
      {"status":false,"message":"Internal Error","errorcode":"AB2001","data":null}

      posted in C#/.Net SDK
      D
      divakar620
    • RE: AB1018 : Failed to get symbol details

      Now Getting Different Error
      Corrected Request
      {"orderid":null,"variety":"NORMAL","tradingsymbol":"NIFTY03NOV2117950PE","symboltoken":"43341","transactiontype":"SELL","exchange":"NFO","ordertype":"MARKET","producttype":"CARRYFORWARD","duration":"DAY","price":null,"squareoff":"0","stoploss":"0","quantity":"50","triggerprice":"0"}

      New Error:
      {"status":false,"message":"Internal Error","errorcode":"AB2001","data":null}

      posted in C#/.Net SDK
      D
      divakar620
    • AB1018 : Failed to get symbol details

      Please find below request and Responses. I loaded instruments couple of seconds back.. Still it showing weird responses.

      Error
      {"status":false,"message":"Failed to get symbol details","errorcode":"AB1018","data":null}

      Request
      {"orderid":null,"variety":"NORMAL","tradingsymbol":"NIFTY03NOV2118250CE","symboltoken":"43477","transactiontype":"SELL","exchange":"NSE","ordertype":"MARKET","producttype":"DELIVERY","duration":"DAY","price":null,"squareoff":"0","stoploss":"0","quantity":"50","triggerprice":"0"}

      Help me where it went wrong.

      posted in C#/.Net SDK
      D
      divakar620