Backtest price clarification

Hi, I’m experimenting using the default algo example and have a few questions.

I ran the DEMA short example on ALBK between 23/8/2017 to 22/8/2018 and noticed that on 20 September 2017:

|20 - SEP - 2017, 12:15:00 PM|ALBK NSE|SELL|-100|73.00|-76.00|EN|
|20 - SEP - 2017, 02:15:00 PM|ALBK NSE|BUY|100|73.73|-149.00|SL|

This means that 100 shares were sold at 12:15pm at Rs 73 and then bought back at 2:15pm at 73.73 since the stop loss was triggered.

However, when I fetch hourly prices via the historical data API, I get the following for 20 September 2017:

Here the times are in UTC so the relevant rows are 06:45 (12:15pm IST) and 08:45 (2:15pm IST). In neither of these rows do we see Rs 73 or Rs 73.73 respectively.

So my question is why were those prices used for the backtest? These are not open, close, high, low, or an average of all 4 - so which prices are used, exactly?

Sorry if this is in the documentation somewhere, I looked but couldn’t find anything specific.


cc @Streak

Hi sohel,

Sorry, for the delay in response. You can always write to [email protected] for immediate assistance.

Let us help you with the methodology used while backtesting and sending notification with an example of supertrend indicator.

To buy using Supertrend, you need to key the below logic

Supertrend -> crosses below -> close

For sell :
Supertrend ->crosses above - > close

During Trading:

For a 1 hour candle , let us say supertrend gives a buy at 10.15 candle ( where you see the Green Buy up arrow ) then the notification will come at the open of the next candle which is 11.15 am because the 1 hour candle has to close for the Supertrend indicator to be complete.

Similar example : when you use the 1 min in candle, if the signal comes at 10.15 candle then the notification is generated and sent at the open of 10.16 candle because 10.15 candle has to complete.

Hope this helps