please ignore
Posts made by N51542847
-
Need help for price interval(Y-Axis) derivation on any trading chart as it displays in browser
Hi Everyone, @admin ,
I am implementing one trading technique which require price interval value(Y-Axis) of any stock / option chart. I have opted "auto" scaling option in chart.
In attached screenshot, price interval in Y-axis is 20.
Please help, how can we get this value.
Thanks in advance for any suggestion or input.
-
Angel one is not reliable for algo trading: getCandleData() method is returning wrong data than there own website's data
Hi @admin
getCandleData() method is returning wrong data. Ideally, Trading API should not return different data than there actual website.
If we check API output data of BANKNIFTY chart (35014 BANKNIFTY31AUG23FUT BANKNIFTY) on 28-Aug,23 at 13:05, getCandleData() method is returning 44522.00 value though actual value on Angelone website is 44516.85
Because of wrong data return from getCandleData() API, my algo has taken wrong trade and lost money.
Here is proof to justify it.
Sample code -
Output:
Algo Trading chart data:
-
RE: How to create GTT for option chart on expiry day
@admin , Can you please help on this.
-
How to create GTT for option chart on expiry day
Hi @admin, Everyone,
I have very interesting situation which thinking how to solve.
I want to create GTT on expiry date of option chart.
As per smart api doc , producttype has to CARRYFORWARD.
So my question is - what value needs to define for timeperiod. I had tried 0(zero) but it is throwing error while GTT creation.
gttCreateParams = { "tradingsymbol": 'BANKNIFTY31AUG2344400PE', "symboltoken": 60484, "exchange": 'NFO', "producttype": "CARRYFORWARD", "transactiontype": 'BUY', "price": 101, "qty": 15, "triggerprice": 100 "timeperiod": 1 } rule_id = obj.gttCreateRule(gttCreateParams)
Any suggestion would be really appreciated.
Thanks in advance!
-
Query related exchange time
Hi @admin , everyone,
I just want to share my experience and looking for your input.
Today, i have executed placeorder api at 9:15:00.000350 AM (my local system time).
But trade got rejected, when i checked order history, i found trade execution time in order history was mentioned at 9:14:59 AM.I have before query -
- Does any one faced same experience.
- Is there any api method to get exchange time so that i can fill time gap / between exchange and my local time ?
-
RE: OpenAPIScripMaster.json returning null data - Fix request
@laxm ,
Yes, i was wondering why it happened. Not sure if there were some maintenance window was there.
It had worked at 9:00 AM. -
OpenAPIScripMaster.json returning null data - Fix request
Hi @admin ,
We are getting "null" return value for OpenAPIScripMaster.json file. Can you please look it as soon as possible.https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json
Thanks in advance
-
RE: challenges using Smartapi
Hi @Mnagesh,
I am developing trade logic on multiple chart. My trade logic require to get OHCL data of 5 min live candle.
getCandleData() method gives this data but it usually gives 20-30 second old data.Can we get same method with live feed or if we improve getCandleData() method to get live data.
Any input will be really appreciated.
PS: i know alternative solution to capture live feed data and calculate OHCL value.
Thanks in advance!
-
History API is stop returning data for any MCX future stock
Hi @admin123 @admin @administrators ,
History API is stop returning data for MCX future stock's data.
Can you please resolve this issue or suggest if any changes has made recently to make it work.Thanks in advance!
Sample code -
def fetchDataOneline(in_exchange,in_symboltoken):
obj = SmartConnect(api_key=apikey)
data = obj.generateSession(username, pud, pyotp.TOTP(token).now())
refrashToken = data['data']['refreshToken']
res = obj.getProfile(refrashToken)
print(res['data']['exchanges'])
try:
historicParam = {
"exchange": in_exchange,
"symboltoken": in_symboltoken,
"interval": "FIVE_MINUTE",
"fromdate": "2023-06-10 15:55",
"todate":"2023-06-22 15:55"
}
historic_data = obj.getCandleData(historicParam)# Extract the candle data from the 'data' key candle_data = historic_data['data'] # Create a DataFrame from the candle data df = pd.DataFrame(candle_data, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume']) print(df) except Exception as e: print("Historic Api failed: {}".format(e.message)) # logout try: time.sleep(1) logout = obj.terminateSession('N51542847') print("Logout Successfully") except Exception as e: print("Logout failed: {}".format(e.message)) return df
in_exchange= "MCX"
in_symboltoken = "244731"Output:
-
Unable to get historical data for commodity future stocks(Example-)
Hi All, @admin
I am using History API to fetch commodity future stock but i am unable to get any data.
Please help what is missing in below code.
Output of above code:
PS: Same logic and code was working fine few days ago also it is working fine with equity, NIFTY50, BankNifty future stock.
-
Unable to get history data of commodity stock SILVER23JULFUT
Hi,
I was using history api to get data of commodity stock from "MCX" exchange but recently i am not getting any data.Please help why
I have collected token and exchange value from https://margincalculator.angelbroking.com/OpenAPI_File/files/OpenAPIScripMaster.json
website.token symbol name exch_seg
244731 SILVER23JULFUT SILVER MCXtry: historicParam = { "exchange": "MCX", "symboltoken": "244731", "interval": "FIVE_MINUTE", "fromdate": "2023-06-01 13:30", "todate":"2023-06-16 13:30" } historic_data = obj.getCandleData(historicParam) # Extract the candle data from the 'data' key candle_data = historic_data['data'] # Create a DataFrame from the candle data df = pd.DataFrame(candle_data, columns=['timestamp', 'open', 'high', 'low', 'close', 'volume']) except Exception as e: print("Historic Api failed: {}".format(e.message))
I am getting below output after running above code.
Out put:
Empty DataFrame
Columns: [timestamp, open, high, low, close, volume]
Index: [] -
TypeError: 'NoneType' object is not subscriptable
@admin
refreshToken = login['data']['refreshToken']
TypeError: 'NoneType' object is not subscriptablePlease help