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 ?
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 ?
@sevrus said in getTotalBuyQty and getTotalSellQty returning invalid values:
@Moderator_3
Is it supposed to be double in the Quote class?
Any update on this please? tbq and tsq are double by definition in the Quote class.
Is it supposed to be double in the Quote class?
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;
}
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);
@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();
hi @Moderator_3 , did you get a chance to look into this?
Appreciate a quick response
double buyQuantity = quote.getTotalBuyQty();
double sellQuantity = quote.getTotalSellQty();
System.out.println(symbol + ": sellQuantity == " + sellQuantity + ", buyQuantity=" + buyQuantity);
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.
<dependency>
<groupId>com.angelbroking.smartapi</groupId>
<artifactId>smartapi-java</artifactId>
<version>2.2.3</version>
</dependency>
Here is how i am trying to get index ticks. But i am not getting the ticks. I dont if it is just me but the doc link https://smartapi.angelbroking.com/docs/WebSocket is nt working for me. Can someone point me to the right doc? or spot what is wrong in my code?
indices = ["nse_cm|26000", "nse_cm|999022", "nse_cm|999031"]
mode = 3
token_list = [{"exchangeType": 1, "tokens": indices}]
ws = SmartWebSocketV2(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN)
ws.subscribe(correlation_id, mode, token_list)
@Moderator_2 , It got resolved automatically. but idk what are the chances of it happening again. my client code is s138496
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}
I am facing this issue while executing smart_api.generateSession (js library)
Hi @admin ,
I am getting this since since today. It's been working fine till today evening.
data = {"message":"Something Went Wrong, Please Try After Sometime","errorcode":"AB1004","status":false,"data":null}
@admin said in Calculate Simple moving average and exponential moving average:
talib
can you please share the talib library link?