@Moderator_2 , It got resolved automatically. but idk what are the chances of it happening again. my client code is s138496
sevrus
@sevrus
Best posts made by sevrus
-
RE: "errorcode":"AB1004" while trying to generatesession using js library
-
"errorcode":"AB1004" while trying to generatesession using js library
Hi,
I am getting this error since today evening when i invoke
smart_api.generateSessiondata = {"message":"Something Went Wrong, Please Try After Sometime","errorcode":"AB1004","status":false,"data":null}
Latest posts made by sevrus
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
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 ?
-
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? -
RE: getTotalBuyQty and getTotalSellQty returning invalid values
Any update on this please? tbq and tsq are double by definition in the Quote class.
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
Is it supposed to be double in the Quote class?
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
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; }
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
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.675931032594153E18does the code look good to you?
double buyQuantity = quote.getTotalBuyQty(); double sellQuantity = quote.getTotalSellQty(); System.out.println(symbol + ": sellQuantity == " + sellQuantity + ", buyQuantity=" + buyQuantity);
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
@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.680789018563052E18and 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();
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
hi @Moderator_3 , did you get a chance to look into this?
-
RE: getTotalBuyQty and getTotalSellQty returning invalid values
Appreciate a quick response
-
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.147483647E9I 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>