Code Execution Slippage

Following was the backtest report in 5 min Periodicity:
1
Corresponding 5 Min Chart : 2

But when I did the live trading on candle completion the order placed was different from the backtest prices as the prices are moved so as my profits are reduced. The following is 1 Min chart3

So I did some calculation at the candle completion price of amibroker and LTP. I found that there is slippage of around 72 points.
4

Please suggest some solution to cover this slippage. I had gone through various KBs present in the sites. This is a sample situation.
http://www.amibroker.com/guide/h_timeframe.html
https://www.amibroker.com/guide/afl/timeframeexpand.html

In live trading, I faced a similar situation where the order is triggered at candle completion and the prices are moved from there. How to tackle this ??

Hi Dhiaj use below code. Then you will always have price with slippage.

SetTradeDelays(1,1,1,1);
BuyPrice=Open;
SellPrice=Open;
ShortPrice=Open;
CoverPrice=Open;
1 Like