Navigation

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

    sevrus

    @sevrus

    4
    Reputation
    16
    Posts
    5
    Profile views
    1
    Followers
    0
    Following
    Joined Last Online

    sevrus Follow

    Best posts made by sevrus

    • RE: "errorcode":"AB1004" while trying to generatesession using js library

      @Moderator_2 , It got resolved automatically. but idk what are the chances of it happening again. my client code is s138496

      posted in Bugs
      S
      sevrus
    • "errorcode":"AB1004" while trying to generatesession using js library

      Hi,
      I am getting this error since today evening when i invoke
      smart_api.generateSession

      data = {"message":"Something Went Wrong, Please Try After Sometime","errorcode":"AB1004","status":false,"data":null}

      posted in Bugs
      S
      sevrus

    Latest posts made by sevrus

    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @Moderator_3

      https://github.com/angel-one/smartapi-java/blob/c568e4f1329ac4b1eb56c3ead08c57c9c29f8351/src/main/java/com/angelbroking/smartapi/smartstream/models/Quote.java#L37

      should this be double here? totalBuyQty and totalSellQty

      lombok is casting it to double in the constructor

          this.totalBuyQty = (double)buffer.getLong(75);
          this.totalSellQty = (double)buffer.getLong(83);
      

      why should these be double ?

      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @sevrus said in getTotalBuyQty and getTotalSellQty returning invalid values:

      @Moderator_3
      Is it supposed to be double in the Quote class?

      @Moderator_3

      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @Moderator_3

      Any update on this please? tbq and tsq are double by definition in the Quote class.

      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @Moderator_3

      Is it supposed to be double in the Quote class?

      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @Moderator_3

      Can you share a sample code or a sample value for totalbuyQuantity ? and may i know why buyquantity and SellQuantity must be in double?

      In com.angelbroking.smartapi.smartstream.models.Quote class

      private double totalBuyQty;
      private double totalSellQty;
      
          public Quote(ByteBuffer buffer) {
              ..
              ...
              this.totalBuyQty = (double)buffer.getLong(75);
              this.totalSellQty = (double)buffer.getLong(83);
              .....
              .........
          }
      public double getTotalBuyQty() {
          return this.totalBuyQty;
      }
      
      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @Moderator_3

      I understand what exponent is. but the number looks incorrect for buy/sell quantities.

      BLKASHYAP: sellQuantity == 4.6869453903254E18, buyQuantity=4.680789018563052E18
      BFUTILITIE: sellQuantity == 4.678757739550212E18, buyQuantity=4.674815715486728E18
      CUMMINSIND: sellQuantity == 4.67815795595726E18, buyQuantity=4.67632397056213E18
      RPSGVENT: sellQuantity == 4.676061874477859E18, buyQuantity=4.66557308330469E18
      SPENCERS: sellQuantity == 4.685811862556639E18, buyQuantity=4.68152445440308E18
      SAGARDEEP: sellQuantity == 4.67504221488205E18, buyQuantity=4.675931032594153E18

      does the code look good to you?

          double buyQuantity = quote.getTotalBuyQty();
          double sellQuantity = quote.getTotalSellQty();
          System.out.println(symbol + ": sellQuantity == " + sellQuantity + ", buyQuantity=" + buyQuantity);
      
      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      @Moderator_3

      @Moderator_3 said in getTotalBuyQty and getTotalSellQty returning invalid values:

      2.147483647E9 representation should not in exponent format it should be 2147483647E9 like this

      Thanks for your response @Moderator_3

      2147483647E9 is also exponentital format right? it ends with E9.

      Here is the response i get:

      RCF: sellQuantity == 4.703818195117539E18, buyQuantity=4.69298182083104E18
      HAL: sellQuantity == 4.688502126991639E18, buyQuantity=4.683909879239279E18
      FEDERALBNK: sellQuantity == 4.703985885673161E18, buyQuantity=4.701179397275648E18
      IEX: sellQuantity == 4.698413811999179E18, buyQuantity=4.695479997148692E18
      IRFC: sellQuantity == 4.7132944971428E18, buyQuantity=4.702934520628773E18
      BIKAJI: sellQuantity == 4.678673214593827E18, buyQuantity=4.67073693966454E18
      BLKASHYAP: sellQuantity == 4.6869453903254E18, buyQuantity=4.680789018563052E18

      and my code :

      Quote Class : com.angelbroking.smartapi.smartstream.models.Quote

      public void onQuoteArrival(Quote quote) {
          String token =  quote.getToken().getToken().trim();
          long feedTimestamp = quote.getExchangeFeedTimeEpochMillis();
          float price = quote.getLastTradedPrice()/100;
          float vwap = quote.getAvgTradedPrice()/100;
          long v = quote.getVolumeTradedToday();
          double buyQuantity = quote.getTotalBuyQty();
          double sellQuantity = quote.getTotalSellQty();
      
      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      hi @Moderator_3 , did you get a chance to look into this?

      posted in NodeJS SDK
      S
      sevrus
    • RE: getTotalBuyQty and getTotalSellQty returning invalid values

      Appreciate a quick response

      posted in NodeJS SDK
      S
      sevrus
    • getTotalBuyQty and getTotalSellQty returning invalid values
          double buyQuantity = quote.getTotalBuyQty();
          double sellQuantity = quote.getTotalSellQty();
          System.out.println(symbol + ": sellQuantity == " + sellQuantity + ", buyQuantity=" + buyQuantity);
      

      the code prints

      PPLPHARMA: sellQuantity == 2.147483647E9, buyQuantity=2.147483647E9
      M&MFIN: sellQuantity == 2.147483647E9, buyQuantity=2.147483647E9
      JIOFIN: sellQuantity == 2.147483647E9, buyQuantity=2.147483647E9
      ONGC: sellQuantity == 2.147483647E9, buyQuantity=2.147483647E9
      NTPC: sellQuantity == 2.147483647E9, buyQuantity=2.147483647E9
      MOTHERSON: sellQuantity == 2.147483647E9, buyQuantity=2.147483647E9

      I am expecting a valid integer/long.

      I am using java smart api 2.2.3

          <dependency>
              <groupId>com.angelbroking.smartapi</groupId>
              <artifactId>smartapi-java</artifactId>
              <version>2.2.3</version>
          </dependency>
      
      posted in NodeJS SDK
      S
      sevrus