How to reduce slippage at entry and exit

#1
I trade and Nifty and SBI Futures in 5 minute timeframe. When I get a signal in Amibroker, it automatically generates an alert in Zerodha Pi using a bridge with all the values filled up (quantity, price, order type etc.). Order type is Limit and price is the Close of last candle which generated the signal. I just need to press the Buy or Sell button in Pi to execute the order and this process takes around 5-7 seconds. If the market is moving too fast (typically SBI is high beta and often spikes), the limit price is not touched and the order does not get executed. I typically wait for a minute or two and if the price does not reach the limit price in this time, I execute the Market order instead of limit order.

This has been happening quite frequently in the last few days and I have lost more than 10k in just 6-7 trades of 1 lot of SBI only due to slippage (result of market moving too fast at the time of signal generation). Sometimes SBI moves by 1-2 points in just a minute (which translates to Rs.3000 to Rs.6000 for a single lot).

I have tried executing market orders only in the first place, but that too eats a lot from the gains and was not sustainable in the long run.

Is there a way to reduce this slippage? Any ideas would be greatly appreciated.
 

mastermind007

Well-Known Member
#3
I trade and Nifty and SBI Futures in 5 minute timeframe. When I get a signal in Amibroker, it automatically generates an alert in Zerodha Pi using a bridge with all the values filled up (quantity, price, order type etc.). Order type is Limit and price is the Close of last candle which generated the signal. I just need to press the Buy or Sell button in Pi to execute the order and this process takes around 5-7 seconds. If the market is moving too fast (typically SBI is high beta and often spikes), the limit price is not touched and the order does not get executed. I typically wait for a minute or two and if the price does not reach the limit price in this time, I execute the Market order instead of limit order.

This has been happening quite frequently in the last few days and I have lost more than 10k in just 6-7 trades of 1 lot of SBI only due to slippage (result of market moving too fast at the time of signal generation). Sometimes SBI moves by 1-2 points in just a minute (which translates to Rs.3000 to Rs.6000 for a single lot).

I have tried executing market orders only in the first place, but that too eats a lot from the gains and was not sustainable in the long run.

Is there a way to reduce this slippage? Any ideas would be greatly appreciated.
There can be few different solutions to this problem based on how and why your AFL generates signals.

Also, 5-7 Seconds is a lot of time for clicking button.
 
#4
There can be few different solutions to this problem based on how and why your AFL generates signals.

Also, 5-7 Seconds is a lot of time for clicking button.
In this case, the signal is generated when a candle closes beyond a line (for example, SuperTrend line). The limit order is at the close price of the candle that generated the signal.

Suppose on a 5 minute time frame, the 10:00 am (start time) candle generates a signal. This candle would close at 10:04:59. The signal is generated the moment the next candle starts forming at 10:05:00 or 10:05:01. The AFL sends the alert using a bridge to the trading terminal in the next second (with all the order details like order type, quantity, limit price, etc. pre-filled). I click on the Buy or Sell button, it asks for a confirmation and the order is send. This takes another 2-3 seconds at least. So the earliest the order gets executed is around 10:05:05 or so, only if the limit price is hit.

Btw, I am using GDFL data feed with Amibroker on a 40 MBPS internet line. So internet speed should not be an issue.

I have not been able to reduce this time. Could you suggest what could be done to reduce this time and/or reduce the slippage?

Most of the times the signal is generated the moment the price starts moving aggressively in one direction, and that's when the slippage come into play. Even if I enter the trade within 3-5 seconds of signal generation, the price would have moved by 0.5 - 1 points for SBI (translating to Rs.1500 - 3000 for a single lot), which is quite a big deal.
 

anuragmunjal

Well-Known Member
#6
In this case, the signal is generated when a candle closes beyond a line (for example, SuperTrend line). The limit order is at the close price of the candle that generated the signal.

Suppose on a 5 minute time frame, the 10:00 am (start time) candle generates a signal. This candle would close at 10:04:59. The signal is generated the moment the next candle starts forming at 10:05:00 or 10:05:01. The AFL sends the alert using a bridge to the trading terminal in the next second (with all the order details like order type, quantity, limit price, etc. pre-filled). I click on the Buy or Sell button, it asks for a confirmation and the order is send. This takes another 2-3 seconds at least. So the earliest the order gets executed is around 10:05:05 or so, only if the limit price is hit.

Btw, I am using GDFL data feed with Amibroker on a 40 MBPS internet line. So internet speed should not be an issue.

I have not been able to reduce this time. Could you suggest what could be done to reduce this time and/or reduce the slippage?

Most of the times the signal is generated the moment the price starts moving aggressively in one direction, and that's when the slippage come into play. Even if I enter the trade within 3-5 seconds of signal generation, the price would have moved by 0.5 - 1 points for SBI (translating to Rs.1500 - 3000 for a single lot), which is quite a big deal.


hi do not see where the problem is ... as per my understanding of what you have said.. the signal candle is one candle before the actual trade candle. you are tracking only one script.. trade manually for a while .. anticipate... you already have the signal..

regards
 
#7
your risk management should include provision for minimum 50 paise slippage in sbi atleast.
Stock futures tend to have high bid ask difference. :annoyed:
Yes, that is the problem. 50 paise for a single lot quite a lot for a strategy to be effective. I am actually incurring a slippage of around this much! Brokerage+taxes that I pay for single lot is less than Rs.200 for a trade (entry+exit) and a slippage of around 50 paise equates to Rs.1500. :(
 
#8
Risk management is a key role. There will ups and down in price.

Money management is how much you are comfortable able to take loss. A fixed percentage of your capital you can decide as loss.

Like 1% of your capital on one trade. If trade does not fixed in your risk amount. Then avoid trade or take in delivery option (Buying).
 

mastermind007

Well-Known Member
#9
In this case, the signal is generated when a candle closes beyond a line (for example, SuperTrend line). The limit order is at the close price of the candle that generated the signal.

Suppose on a 5 minute time frame, the 10:00 am (start time) candle generates a signal. This candle would close at 10:04:59. The signal is generated the moment the next candle starts forming at 10:05:00 or 10:05:01. The AFL sends the alert using a bridge to the trading terminal in the next second (with all the order details like order type, quantity, limit price, etc. pre-filled). I click on the Buy or Sell button, it asks for a confirmation and the order is send. This takes another 2-3 seconds at least. So the earliest the order gets executed is around 10:05:05 or so, only if the limit price is hit.

Btw, I am using GDFL data feed with Amibroker on a 40 MBPS internet line. So internet speed should not be an issue.

I have not been able to reduce this time. Could you suggest what could be done to reduce this time and/or reduce the slippage?

Most of the times the signal is generated the moment the price starts moving aggressively in one direction, and that's when the slippage come into play. Even if I enter the trade within 3-5 seconds of signal generation, the price would have moved by 0.5 - 1 points for SBI (translating to Rs.1500 - 3000 for a single lot), which is quite a big deal.
Hmmmm

So, effectively, You are relying on a crossover. There are two things you can do. Your primary source of problem is delay in time and slippage in price is symptom of that problem.

One thing that you can do is instead of relying on Close, rely on High for entry.

This will eliminate repaint of signal and will allow you to enter within a second of price moving above the horz line but this approach will increase chances of getting trapped in false breakouts and your calculation of levels will have to somehow factor that away.
 
#10
Hi

Do a back test to check on your system/afl to see how many false signals you get if your signals triggers few seconds before the close of the candle.

i.e check for the signals reversing in last 5/10 seconds.

Now compare the cost of this to actual slippage / impact cost for your trades.

Choose the better option and be happy with it :thumb:


Happy :)
 

Similar threads