Trading software collection books39 comments
Forex trading without broker
It looks like you're new here. If you want to get involved, click one of these buttons! Categories Recent Discussions Activity. Hey guys, I thought it would be good if we keep a thread that talks about how much slippage is experienced by users of kiteconnect. Would be good to share light on how much latency, volatility and slippage is observed across equities, commodities, futures and options Best, Arnav.
Sometimes the first attempt fails and the trades goes through on second attempt The script takes care of automatic retry. Sometimes most trades fail system tries for 10 times max , 2 Slippage - when there are many trades, it has been ok Tends to even out over time.
I suspect that the trades were fired when the index was on a steep slope Can you help, how are u handling the orders list. I believe you may be keeping a copy of kite. Or may be keeping your signals list and joining the other details from kite. Which approach are you using? I also want to start recording slippages in my trades. Can you please guide Since the question of slippages came up. With any discount brokerage there seems to be high slippage. I donot know the reason behind this, but this is the experience talking.
When I run the same algo,generated with almost the same time 10ms difference on any given ordering non-discount brokerage has better order fill quality. Shaha Yes, I am comparing the stored value from signal generation and the value from kite.
If you have any specific questions, pls ask. Hi,any observation regarding historical data API slippage? On the latency front, I have been routinely placing orders within latency of 1. I haven't measured the delay in subsequent fill though as I keep polling API every 15 seconds to find new fills, rather using using postback. That said, I face frequent connection issues. Further, while placing Market orders at Entry, I typically fetch the prevailing mid price from the Websocket data-feed, and use that mid price as Limit Price to place orders.
I do this to minimize slippage. In my experience around 95 percent of such orders get filled. When markets move fast and that is when one desperately needs fills , I have seen orders remaining unfilled.
But please note, in this case there is double latency: In addition, there is processing time spent by algo in between receiving data and placing order. A trader who is placing market orders to Zerodha by monitoring prices at his end and then firing market orders at certain triggers suffers from these two latencies plus processing time and hence will likely encounter more slippages. Such slippages can be greatly reduced by one of these two methods: In both orders, the task of monitoring the trigger price is pushed to Zerodha's co-location facility at exchange, where latency is minimal.
Rather than placing a Market order, place a Limit order at prevailing price when triggers are fired. However, in this case, trader will miss a few trades. So if the algorithm fires a lot of trades and is sensitive to slippage, the total slippage saved by placing limit orders, hopefully over time, will be more than the notional profit which could be made on missed trades.
For an algorithm which trades infrequently, has a high accuracy or where slippage is not a key criterion, trader may stick to market order. I could clearly see that on Nifty futures, the websocket was permanently trailing behind, however the latency wouldn't be more than 1 second, though I didn't measure it. Some recent example on slippage: Rather than placing Market Orders, to enter at Market I place Limit order at prevailing mid price price from Zerodha Websocket to save on slippage.
Using this method, yesterday at around , Out of 5 lots which I tried to buy for Infratel order staggered one lot per minute , I got filled for four. Today with same attempt, I got filled for 2 out of 5. Both day stock was moving sharply at that time.
This is coming at extremely liquid time of the day. The time taken by my algo to process data and place order is less than ms. What about slippage in Exiting the position I mean by exiting early in a profitable trade or late exit in losing trade? Are you giving this much importance to tour exit also?
Did anyone have data about how much missed due to poor exit plan? Our discussion here is limited to first issue: If the average slippage is high, it is akin to a fixed cost on your trading operations. Further, if the strategy trades frequently and thus tries to make small profits on each of a large number of trades it executes, slippage could make an otherwise profitable strategy a loss making one.
On the entry side, one can try to minimize slippage by entering though limit order only. The cost here is that if you got the direction right but movement was fast then you will miss out on a few profitable trades.
On the exit side, generally you would avoid placing a Limit order, because if it doesn't get filled and market races against you, you may end up with a big loss on that trade. The management of slippage is important for efficient execution. However, you seem to be talking of another issue: For a fully automatic algo, backtesting with a lot precautions is considered compulsory.
Even after that it is very difficult to say if the strategy is going to perform in live market. During the design of the algo and its back-testing, one has to experiment with both his entry plan and exit plan and implement the best-looking plan.
You are right here, exit plan is as important as entry plan. Unfortunately, there is no good entry or exit plan. It all depends upon what you want to achieve. If you want to catch one the the few, but large sustained moves, you will have to probably keep a wider stoploss as well as not book profit quickly. However, if you want to place a large number of trades with small profit targets, you may have to exit the first moment the trade starts under-performing.
There are plenty of other techniques one can use for example trailing stoploss, parabolic exits, donchian breakouts. But in a nut shell, there is no good and bad exit plan. The reason is that there is no consistent pattern in stock prices.
Stock prices are a result of human actions in the market and it is best to assume that they move completely random in short run. So while one exit strategy may look good and work for one month, it may fail in the next month on the same stock.
You keep experimenting till you find something that suits you. However, one thing is certain. A lot of algos fail because the price in a lot less slippage than actually experienced in the market. I personally work with a high 0. This will include all brokerage, taxes and slippages. Hi skk many thanks for your detailed comments. Is it too low? What do you think? Shaha It will depend upon what scrips you are trading , your trade size, and your frequency of trading, and your holding period.
The more illiquid scrips you trade say you start moving from Nfity 50, to nifty and then to and then to , the bigger your trade size is, the higher the frequency and lower the holding period, the slippage will keep increasing.
Currently I trade intraday and slippage can make or break my system. Hence, I personally subscribe to philosophy that make the worst case assumption on slippage and work so that you cannot go wrong on it.
Unfortunately, I feel smug on my assumption, and have not put in requisite effort to calculate the slippage I actually encountered. I probably will put in some work on this. But I would encourage you to work this experiment: If the model turns unprofitable, I think you should reconsider it. You need to build in margin on safety. Backtest has inherent execution assumptions you trade at exact second when signal was generated, you don't miss any trades, it will include fast moving trades which you will most likely miss, some of the profitable trades will have such high profits that you will not likely see those trades in the real market curve fitting which are not feasible in live trading.
I would say, increase your slippage, half your returns in back-test, double your Maximum drawdown, and these are the numbers you should target.
Also, if you use trailing SL, the slippage tends to work against you - by the time your order gets executed, the price would've moved further out in the wrong direction. But if you have fixed Take-Profit, the slippage works in your favor mostly, because the price momentum is in favorable direction. So if your trade count is high, fixed TP is the way to go, to avoid high slippage. I'm fairly new and yet to figure out my strategy. I have some questions for you.
Feel free not to answer some if it digs into your system. I try to keep it system level. Because this can create a slippage due to time overhead on calculations. Do you have any fallback for datafeed? I have seen sometimes kite websocket fails.