@mohan1710
Same issue here as well. I tried WebSocket Streaming 2.0 and this also does not work.
skgkrish
@skgkrish
Best posts made by skgkrish
Latest posts made by skgkrish
-
RE: Streamer is not working
-
RE: Unable to get to tick data
@Ramesh
Same here.. tick data does not work with both websocket1 and websocket2 -
Tried the WebSocket Streaming 2.0 and I am not getting market data
Tried the WebSocket Streaming 2.0 and I am not getting market data. Can someone help me on this.
I am using python library
This is my code"""
Created on Monday Feb 2 2022@author: Nishant Jain :copyright: (c) 2022 by Angel One Limited
"""
from SmartApi import SmartWebSocketV2
from smartapi import SmartConnect #or from smartapi.smartConnect import SmartConnect
#import smartapi.smartExceptions(for smartExceptions)
API_KEY = 'xxxxxx'
CLIENT_CODE = 'xxxxxxx'#create object of call
obj=SmartConnect(api_key=API_KEY)#login api call
data = obj.generateSession(CLIENT_CODE,"xxxx",'xxxxxx')
print(data)
refreshToken = data['data']['refreshToken']#fetch the feedtoken
feedToken = obj.getfeedToken()
#fetch User Profile
userProfile = obj.getProfile(refreshToken)
AUTH_TOKEN = data['data']['jwtToken']
FEED_TOKEN = feedTokencorrelation_id = "ABCDEF1235"
action = 1
mode = 2#token_list = [{"exchangeType": 1, "tokens": ["26009"]}]
token_list = [{"exchangeType": 5, "tokens": ["240284"]}]
sws = SmartWebSocketV2(AUTH_TOKEN, API_KEY, CLIENT_CODE, FEED_TOKEN)
def on_data(wsapp, message):
print("Ticks: {}".format(message))def on_open(wsapp):
print("on open")
sws.subscribe(correlation_id, mode, token_list)def on_error(wsapp, error):
print(error)def on_close(wsapp):
print("Close")Assign the callbacks.
sws.on_open = on_open
sws.on_data = on_data
sws.on_error = on_error
sws.on_close = on_closesws.connect()
-
PlaceOrder API does not work for SBIN-EQ/BUY/MARKET/MARGIN/DAY
I get this error when I placeorder
------placeOrder call output-------------
{"status":false,"message":"Internal Error","errorcode":"AB2001","data":null}The same inputs work on the trading portal(https://trade.angelbroking.com/)
This is my code:
//Place Order
OrderInfo ord = new OrderInfo();
ord.variety = Constants.VARIETY_NORMAL;
ord.tradingsymbol = "SBIN-EQ";
ord.symboltoken = "3045";
ord.transactiontype = Constants.TRANSACTION_TYPE_BUY;
ord.exchange = Constants.EXCHANGE_NSE;
ord.ordertype = Constants.ORDER_TYPE_MARKET;
ord.producttype = Constants.PRODUCT_TYPE_MARGIN;
ord.duration = Constants.VALIDITY_DAY.ToString();
//ord.price = "469";
//ord.squareoff = "0";
//ord.stoploss = "0";
//ord.quantity = "1";
//ord.triggerprice = "0"; //OPTIONAL PARAMETER
//ord.triggerprice = "350"; //OPTIONAL PARAMETERobj = connect.placeOrder(ord); OrderResponse Ores = obj.PlaceOrderResponse;
-
RE: Please enumerate the Order status in com.angelbroking.smartapi.utils.Constants
@admin Please provide the list of all possible Order status values.