When a quantity is traded, there is a buyer and a seller. I think you are trying to assess is the trade ending up price direction up or down. Then yes, you can. Just see compared to last traded lot, the lot price has moved up or down
By the way if you still want to extract FnO from NSE, it is working
import requests
from bs4 import BeautifulSoup
headers = {'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) \
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3…
Why are you doing all this scrapping ? And if you were, scrapping without using BeautifulSoup ?
Anyway, why don't you just use Instrument file that Zerodha provides everyday in the morning ? It has it all. If you have a Zerodha Kite account
Although I really wonder why wrote all this if you really want to just work on ORB. But let me tell you the issue is that your first if condition would always keep working as it is >= start time
And worst your second condition is a == for an exa…
@samphel First of all this program is a total mess. You don't do so much condition inside on_tick. Anyway I wouldn't want to get into that detail
To answer your question, I need to see indented python code as you can see your code copy paste has l…
I don't think you would get answers to indicator or trading approaches on this forum.
On this forum queries related to kite libraries / APIs are answered
Today also BOs were blocked on every instrument that I checked don't know about rest but it is not mentioned in this bulletin. There should be a programmatic download of historical days BO blocks and also about current day if BO is blocked
If you think about what you want to do before learning programming, you will get frustrated and feel helpless. First learn programming, without think about programming and trading together
@themohammedfaisal I saw the response just now. I tested it in the morning but still I appreciate your detailed answer.
So thank you very much. Admin can close this thread
Not these but I figured it out. One confirmation I needed
For SL Bracket Order Buy
Trigger Price is less than Buy Price
For SL Bracket Order Sell
Trigger Price is greater than Sell Price
And does the order starts filling the moment trigger price …
@ZI4453
Adding all weekends in array is an inefficient style of programming when you can check today with weekday number and identity if weekend or not. Request was only for Holidays response.
Anyway, I have modified the code. Now it just returns …
Saw this post today, so quickly wrote something in python to return holidays as an array.
You can import in your program and use it like
if today not in holidays():
os.exit(1)
Code at
https://github.com/tahseenjamal/nse_holidays
Let us say in the account I have Rs 10,000 margin at 9am and at 10am I purchased some shares. The blocked margin might be Rs 7,500 and unblocked margin would be Rs 2,500
So I was wanting to know the blocked margin of my total margin through an API
@sujith
Yes that is one way. There is one more way that am using currently. But last I read on the forum, you have new option of market entry for Bracket Orders
@sujith thanks but this API of Net P&L I understand but it is not post tax and STT and other things. I want the API or formula that you are using in the Brokerage Calculation Sheet. I want to arrive at Net P&L Post brokerage and taxes in my …
Ok so this worked in Python for kite 3.0 for Bracket Order
kite.place_order(
variety=kite.VARIETY_BO,
exchange=kite.EXCHANGE_NSE,
order_type=kite.ORDER_TYPE_LIMIT,
tradingsymbol=tradingsymbol,
transaction_type=kite.TRANSACTION_TYPE_S…
Monday - 18th December
I could exit orders that had not got executed (executed means trade entered but trigger and square off pending)
Executed orders with trigger pending and square off pending were not squared off at the market. I had to go to K…
@Kailash your details are little confusing. When you say BO with SL ? We already have SL in the Bracket Order. The moment price hits that SL Price, that stock is squared off at the market
@sujith
Finally, this worked
"https://api.kite.trade/orders/bo/171211000832542?api_key=xxx&access_token=yyy&parent_order_id= 171211000832538"
Means I need to only pass TP order_id and parent_order_id
Ok about now closing the positions t…
@tonystark
@sujith
@Pushwinder
Before that let me put things clearly
IOC SELL Bracket Order executed
Now standing SL and TP as below
name, order_id, parent_order_id
IOC 171211000832542 171211000832538 OPEN
IOC 171211000832543 171211000832538 …
@tonystark route /bo doesn't exit was the message that I got. Are you sure /bo exists ? Please check for xxx154 cancel requests that came for /bo route and got an error response
@sujith
So it is only working like this
kite.order_cancel(order_id=order['order_id'], variety="regular", parent_order_id=order['parent_order_id'])
in API also valid route is just /regular
But note it is not exiting the executed order. It is jus…
you pointed me to that document. I will copy paste the information here and tell me if it is correct
# Exit / cancel a bracket order.
import requests
response = requests.delete("https://api.kite.trade/orders/regular/151220000000000?api_key=xxx&…
Doesn't kite.order_cancel return a response instead of error ? If it returns a response, I can use it to continue else I would have to use double try/except because of this
OrderException: Please select a valid BO Order to Exit
Below is the code. Tabbing was not working so I used underscore here to show tab space
orders = kite.orders()
for order in orders:
____try:
________kite.order_cancel(str(l['order_id']), variet…
So like I pulled orders and I had for example this
order_id, parent_order_id
171207000447158, 171207000433530
171207000447159, 171207000433530
What should have been the way to cancel it ?
@sujith
One last question. So not only will this cancel orders that are executed and standing for StopLoss or Target
But will also cancel bracket orders that were never executed because their limit order was never executed and therefore don't have…
@sujith
So please confirm below
1. The bracket order is placed
2. The bracket order (buy or sell) is executed and trigger and target pending
3. order_cancel is run passing variety="bo" and parent_order_id of bracket order and this would square of…
@sujith
You mean use this
order_modify(
self, order_id, parent_order_id=None, exchange=None, tradingsymbol=None, transaction_type=None, quantity=None, price=None, order_type=None, product=None, trigger_price=0, validity='DAY', disclosed_quantity…
Outstanding, this is good. This you all implemented recently ? So means I can execute multiple bracket orders of same instrument and all of them would be independent of others ?
See I know bracket order executed. But I don't know if that Bracket Order's Target or SL is hit or not. At the moment I am managing using pair approach because am using only Bracket order, so I know if I get 2 status in an instrument as COMPLETE, i…
You didn't understand my question. Whether Orders API or Postback, the data is same. My question is how to know from that data that an open executed bracket order has hit its SL or TP ? Which I am guessing is when there are two COMPLETE status, it m…
Am using pair concept. A bracket order would have to COMPLETE status to finish completely if am correct. First COMPLETE is of entry execution and second COMPLETE is for SL or TP hit
@sujith This is not fair. If you are giving 120 TPS and if I follow it then how does it matter how I pull the data. Am paying for that service.
You ask asking me to pay for history at 120 TPS and then asking me to build it by myself using Web Socke…
Please thanks. I am getting 504 even today when I have more than a second delay between two requests.
Am worried that in live trading, the history request might fail resulting in strategy failure
@ajinasokan I checked nowhere is the route /bo mentioned
Please share print screen of the same. In fact from the document it seems that the order_variety in the payload internally define the redirect to the /bo route
I tested that just now and tha…
Again did some work and found that the API route for bracket order is /bo and not /regular
Your documentation on the website doesn't even mention that the route has to be changed for bracket orders.
I mean what is this ? Are we suppose to experime…
I was using same from and to dates. Means I was pulling for a single day only. That is what is surprising. That for a single day, at 4pm it gave Gateway Timeout.
I mean it is not even market hours
Which also means if I have a trading strategy and…
I am getting responses and data but many a times 504 even when I have 100Mbps UP and DOWN speed. Your gateway is timing out. This is not the 403 request rate issue
I found the reason. On your Kite Connect page you have incorrectly written how the post data is submitted via requests.post function of requests module in Python
Default payload is JSON format. Your documentation on site is incorrect. Please correc…