Difference in Backtest vs Alerts history

Assuming you have a scan that use’s daily candles and you have a alert as well for this scan that runs every 5 minutes, the results that you see during market hours in the backtest and your alert history, will change, for the current day(as the candle is still being made while the markets are open).

While calculating the backtest results, the daily candles considers values until the current time(when you are viewing the scan), whereas when the alerts are sent, example at 10:05am, the daily candles contained data only until that time, so the results of the backtest graph will change thru the day in such a case. We have already added a note for the same, stating “Backtesting considers values as per completed candles of the timeframes, this may cause the results to change for the latest candle/time as its candle is being built.”

Backtesting considers the daily candles as of the current time, rather than when the alerts were actually run example at 10:05am or 12:50pm, so the results may not match with what you see in the backtest history along with your alerts history due to the above mentioned scenario.

If you want to show the same results in the backtest, you should have similar timeframes as per your alert eg: 5 minutes instead of “latest close” in the scan, this will ensure the backtest runs with the data of the 5 minutes timeframe, which will not change for completed cnadles i.e 9:15am, 9:20am and so on.. so that the backtest can then consider the close of the 5 minutes and plot the rows accordingly.

There’s no way to have this implemented in the backtest as well in the alerts, the reason being, if you view the chart for RSI on a daily timeframe for yesterday’s candle, it show’s the value as of 3:30pm, but actually the RSI on a daily candle at 9:15am for example would differ when compared with the RSI of at 10am or 11am or 3:30pm, but the charts only show yesterday’s RSI considering the daily completed candle i.e as of 3:30pm.

The same is being applicable for “close” or the “ltp” as well, which changes for a daily candle thru the day, so the results of the current completed candle can change, similar to the results that you view in the scanner at different times during the day

We have already added a note implying the same, that the current candle’s results can change(the same is true for any candletsick chart) as well, as the indicator values are as of the latest completed candle time.

73 thoughts on “Difference in Backtest vs Alerts history”

  1. It means if I use 5 min time frame in screener and I select 5 min in alert it shows equal result in back test and alert… am i right?

    1. Yes, correct. As the 5 minute candles completes every 5 minutes, so the results of the past completed 5 minute candles wouldn’t change

        1. No, if your scan use’s just a single timeframe i.e 1 minute, the results in the alert history and backtest will remain the same.

        2. If you entire scan contains only 1 minute candles, back-test would be accurate. If it consists of 1 minute and any other time frame, there are chances back-test may not always be accurate.

      1. hi Akash… iam a premium user of chartink…
        My setup is 5 min candle closes above R1 pivot… Alert run time was every 5 min…

        iam getting alert after 2 minutes of my condition satisfied.. how to get alert as soon as my condition met i mean at the exact time of satisfied condition..

        Yesterday (11-06-2021) My Custom Scanner found PEL(Piramal enterprises) @ 9:25AM, but i got alert @ 9:27AM.. i missed the trade entry…

    2. There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/
      ​​​​​​​
      Hope this helps on back-testing:
      https://chartink.com/articles/?s=back

      It will show the previous days/ minutes results for your scan without the need for you to modify the scan. Back-testing will not give alerts. It is only to analyze/ view stocks previously triggered by your scans.  If you click on any of the bars on the graph, it will show the list of stocks that triggered as per the scan previously. 

      Back-test data will show data for the lowest candle time frame in your scan. If lowest time frame is 1 minute, it will show results for last 1 minutes. If its on daily candle it will show data for past 6 months. We show results for the past 150 bars  in our backtest section, these 150 candles could be of any timeframe, depending on the lowest timeframe in your scan, so for 5 minutes for example, you would get 2 days, for 1 minute, half a day and so on. 
       
      If you have the alert frequency of 5 minutes on a 1 hour candle scan, the alert results will update every 5 minutes and so will the backtest results(if you open the site and view the graph every 5 minutes), the difference is that the alert keeps a history of all your stocks triggered every 5 minutes i.e at 9:20am, 9:25am and so on via the alert history page,, whereas the backtest graph doesn’t keep any history as such, it will show the results only as of the candle completion time i.e 10:15am. so its not necessary that the backtest will show all the stocks that were triggered every 5 minutes as your alert show’s.

      Alerts is a premium feature that would allow you to do this, it keeps a track of all your stocks that met the condition every 5 minutes so that you don’t need to keep a track of them manually in the scanner page or the backtesting graph. The backtest is a dynamic graph that would update/change as your 1 hour candle is changing.

  2. In the morning, i got alert few stocks for a particular scanner but those are not shown in the Backtest panel. Similarly for a particular scanner, few stocks shown in the backtest panel but didn’t got alert. How many of you guys facing same problem??

    1. There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/
      ​​​​​​​
      Hope this helps on back-testing:
      https://chartink.com/articles/?s=back

      It will show the previous days/ minutes results for your scan without the need for you to modify the scan. Back-testing will not give alerts. It is only to analyze/ view stocks previously triggered by your scans. If you click on any of the bars on the graph, it will show the list of stocks that triggered as per the scan previously.

      Back-test data will show data for the lowest candle time frame in your scan. If lowest time frame is 1 minute, it will show results for last 1 minutes. If its on daily candle it will show data for past 6 months. We show results for the past 150 bars in our backtest section, these 150 candles could be of any timeframe, depending on the lowest timeframe in your scan, so for 5 minutes for example, you would get 2 days, for 1 minute, half a day and so on.

      If you have the alert frequency of 5 minutes on a 1 hour candle scan, the alert results will update every 5 minutes and so will the backtest results(if you open the site and view the graph every 5 minutes), the difference is that the alert keeps a history of all your stocks triggered every 5 minutes i.e at 9:20am, 9:25am and so on via the alert history page,, whereas the backtest graph doesn’t keep any history as such, it will show the results only as of the candle completion time i.e 10:15am. so its not necessary that the backtest will show all the stocks that were triggered every 5 minutes as your alert show’s.

      Alerts is a premium feature that would allow you to do this, it keeps a track of all your stocks that met the condition every 5 minutes so that you don’t need to keep a track of them manually in the scanner page or the backtesting graph. The backtest is a dynamic graph that would update/change as your 1 hour candle is changing.

  3. I would suggest to change the name to BackSCAN or PastSCAN as backtest is misleading.
    Also, it would be great if you could actually provide backtest results. This would help us to improve our scanners based on backtest results.

    1. There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/

      Hope this helps on back-testing:
      https://chartink.com/articles/?s=back

      It will show the previous days/ minutes results for your scan without the need for you to modify the scan. Back-testing will not give alerts. It is only to analyze/ view stocks previously triggered by your scans.  If you click on any of the bars on the graph, it will show the list of stocks that triggered as per the scan previously. 

      Back-test data will show data for the lowest candle time frame in your scan. If lowest time frame is 1 minute, it will show results for last 1 minutes. If its on daily candle it will show data for past 6 months. We show results for the past 150 bars  in our backtest section, these 150 candles could be of any timeframe, depending on the lowest timeframe in your scan, so for 5 minutes for example, you would get 2 days, for 1 minute, half a day and so on. 
       
      If you have the alert frequency of 5 minutes on a 1 hour candle scan, the alert results will update every 5 minutes and so will the backtest results(if you open the site and view the graph every 5 minutes), the difference is that the alert keeps a history of all your stocks triggered every 5 minutes i.e at 9:20am, 9:25am and so on via the alert history page,, whereas the backtest graph doesn’t keep any history as such, it will show the results only as of the candle completion time i.e 10:15am. so its not necessary that the backtest will show all the stocks that were triggered every 5 minutes as your alert show’s.

      Alerts is a premium feature that would allow you to do this, it keeps a track of all your stocks that met the condition every 5 minutes so that you don’t need to keep a track of them manually in the scanner page or the backtesting graph. The backtest is a dynamic graph that would update/change as your 1 hour candle is changing.

  4. Looking for backtesting graph for alteast a year for 5,10,15 mins chart..with just 2 or 3 days of data nothing can be done..Please help

      1. You should give it in bold letters at the backtest screen itself. I was wondering how the values of even yesterday’s backtested scrips changed when searched for the same in morning and then again in evening today.

  5. HELLO SIR.
    i have make my dashboard but orb and top gainer and losser only few contract can be seen, we have to draged down top to bottom every time can we see more than like 12 to 15 share at a time.
    like horizontal we can increase the size can we increase the size vertically also ..
    and can be make losser share with red or customized colors ..
    thanks in advance.

    sanju

  6. hello sir
    many times we have to make formula for % . could you please make so every time we dont have to write the formula instread of it we write yesterday 4 % more.
    and can you put a tick button in front or in end copy particular scan .
    so to just copy particular line of scan we can add and paste scan to our scanner
    thanks

  7. i think all people complaining about the difference are WRONG. Their scan code is flawed.

    Just think about it, LATEST CLOSE/HIGH/LOW keeps changing till the day is over. Even your backtests performed during different time will give different results.

    So stop blaming chartink and ask a pro-coder to code things for your alerts.

    1. You are correct, but what we are looking is that the “latest” candle should calculate the current time(scan running time) as the close of the day candle every time when run the scan. In that case, we can get alerts as soon as it happens and no need of waiting for all the day to finish to get the alert. For example if there is a scan for latest high more than one day ago high – Then as soon as the candle break yesterday high it should give signal. I know that it may go down after some time and may end up less than yesterday high at the close. But if it crosses any time it should give alert, that is what we looking for. Now what we are seeing is that in the back test results, there are plenty shares met our criteria and in alerts very few giving alert. And should not show in the back test history if it closes less than yesterday high.

      1. You may set alerts to run every minute and you will get alerts for the same. If by the end of day, stock does not match the scan criteria, it would not display in back-test results as at time of candles close, stock was not longer matching all scan criteria.

      2. Dear, I have also seen today that stock met criteria at 0950 hrs as broken high of the previous day but alerts came at 1023 hrs. At least it should come delayed by 2-3 minutes. However all 5 minutes time frame conditions giving accurate alerts but it is of no use.

      3. Yes why dont you give alert at backtest timing match.
        Spontaneously. This is important issue.
        Extra numbee of alerts may work better
        Rather than less alerts

  8. I have a daily and 5 min candle filter in my scan and I was testing it real-time today. During the course of the day, I got 27 results which i noted down along with the time they appeared.
    At the end of the day, only 12 of those 17 could be found on the graph.
    I understand the limitations of the backtest results. But once a result has popped up in the back-testing graph, it should not vanish at a later stage i feel.

    1. Hello,
      There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/

  9. Hello Chartlink Support
    I have a scan with 15 minute candle with Alert every 5 minutes. However I find that a particular stock, say “Axis Bank” that got triggered and came in alert at 9:55, remained on Alert through 10:05, and then went out of the Alerts page, did not come back on Alert at 11:45, when the conditions again matched at 11:45 bar for the particular stock. Wanted to understand why this is happening. Is there any scope of debugging

    Thanks
    San

    1. For example on a 10 min scan, there is the 12.55 candle which was forming. Candle formation completes at 13.05 and that is the time you got the alert. 

      You may set alerts to run every 1 minute if you want the alerts to check for stocks on an incomplete 10 min candle. By doing this it is possible at times, you get an alert at 12.57pm but by the time candle formation is complete, the stock may not longer be matching your criteria and you will not see the same in back-test results. 
       
      ​​​​​​​

  10. Hi Chartlink Support
    for a formula which has the parameters , A greater than equal to B- y.B where y is a numerical, does the formula require brackets, viz A greater than equal to Bracket (B -y.B) for executing correctly or we can ignore brackets?

    Thanks

    San

  11. What will I do for making difference between backtest and alert time? whether it will minimizing with minimizing difference in time frame? If in scanner there is time frame 30min and 25 min then what will be alert and backtest time.and what is if it is latest candle(one day) and 1min candle then the difference of alert and backtest time will be reduce?

    1. Back-test would display results for the smallest time frame candle used in the scan. Backtest always displays the starting time of the candle.

      There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/

  12. इंट्राडे ट्रेडिंग करने के लिए जो इंडिकेटर बनाए जाते हैं उसके लिए कौन सी किताब से chartink पर इंडिकेटर बनाने में सहायता मिलती है ऐसी कोई लेटेस्ट किताब हो तो कृपया उस किताब का नाम बताने का कष्ट करें

  13. For which indicators are made for intraday trading, which book helps in making indicator on chartink? If there is a latest book, please feel free to name that book.

    Please help me

  14. Hi,

    I am a premium member. I have a scanner on 5 minute time frame. I am getting option to download 1 year historical back testing data but when i open the downloaded csv file, i see that the data is only for 1 month. Please help.

      1. Do u guys really read the msg before replying or just reply for the sake. I have clearly mentioned that I am a premium member and that too since last 3 months. Hope this time you will reply after reading my msg carefully.

  15. Dear sir
    In backtest result only date is coming. I want time should also come along with date .pl guide me

  16. I have 5 min candle filter in my scan and I was testing it real-time. There were 10 stocks in the first 5 min candle that is formed, when i checked it again after 1 hours what i observed first 5 min candle which was formed already stocks changed. As per as my thinking is once candle is formed the stocks should not changed. Why there is such changes in stocks even though the candle is formed long time ago there should not any changes in candle which is already formed.( Kindly note I am asking about scanner not alert)

    1. There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/

      Backtest is built on the fly. If you are using a 5 min candle and a 30 min candle in your scans. Say at 10:15am, 30 min candle begins its formation, at 10:20am, the 5 min candle matches the scan conditions, now later at 10:30am, the 30 min candle also matches the scan conditions. In this case, you will not get an alert but the back-test will be populated for the 10.20am 5 min candle as this candle matched all scan conditions along with the current 30 min candle.

  17. Still there is confusion in backtesting…it is showing different data for same date in different scan dates…if i scan scanner on 7th..result for 7th getting change when i run that scanner on 8th…how is that possible….?????

  18. I had made (15 minutes) intraday finding stocks scanner and my confusion is on backtesting history. As per rule I got stocks in scanner every 15 minutes( if criteria filled ) ..what happened here is that ( continues observed )
    I am not got stocks on time to time for example at morning 9:30 I have not got any stock ..time goes and suppose that it’s 11:15 ..at 11:15 I got stock (ex wipro) ..and the same (wipro ) stock suddenly appeared at morning time says 9:30 …means in morning there’s no stock, scanner find at 9:30 ..but at 11:15 the scanner find wipro and same wipro stock also appears in morning time says 9:30 ..it will be helpful to me if chartik explain me ..what is happening here ?

        1. 15-7-2021
          HCL tech first came in scanner around 10:50 ..and now scanner showing me …it’s time 9:15 , 9:30 and so on…

        2. Hello,

          The reason why the you see this is because you are using multiple timeframes in your scan, How the scan works is say for example you write a condition as below:

          5 min close > -1 5 min close
          and Latest RSI (daily candle) > 60

          When you run the scan at example 10:17 AM, A stock ABC suppose having the latest 5 min close value is 100 and previous 5 min close value is 99. This fulfils the 1st condition. Now suppose at 10:17 AM the latest RSI value i.e the daily candle RSI was 64, now this also fulfils the 2nd condition. Hence the stock ABC will be displayed in the results.

          Now say if you run this same scan at 11:06 AM(around 1 hour after the first run) the values that the 2nd filter would see i.e against the daily candle would be as of 11:06am(& not as of 10:17am), this would cause the backtest results to change/update/repaint because the daily candle impacts the results of all earlier time’s shown in the backtest (i.e for the current day as the daily candle is not yet complete).

          Note, this is the same behaviour that you’d notice on a candlestick chart i.e viewing a candlestick chart on a daily timeframe at 11:06am, would show the RSI or any indicator value as of 11:06am and not the values that were present at 10am or 10:30am and so on.. this causes the backtest the backtest results to change/update.

          Hope this clarifes the confusion here.

  19. Thanks chartink for clarification. First I’m using different timeframe in my scanner 15 min and 1 day. the scanner process is that if two filter meet ,the results is display.what I understood is (particularly talking about my scanner) if 1 day candle filter condition meet , the first one filter ( 15 minutes candle ) had already been met and the daily candle affect the results of all earlier time’s shown in the backtest and same stock repeat again and again until latest daily candle behaviour.

    Correct me if something wrong here..

  20. hello sir, i my case my scanner backtest shows different results in same day, at first it didn’t show techm and Tatamotor later it show’s that shows at 9:15 but when i checked at 9:15 to 10 am scanner didn’t show any of those stocks.plz help me improve my results

    1. Hello,

      Please share the link/ url for the scan so we can review and respond.

      Note:
      1)Backtest always displays the starting time of the candle and not the time alerts are triggered.

      2) There are chances that the backtest results may not match with the alerts history if multiple timeframes are used in the scan, please read our for more details: https://chartink.com/articles/backtest/bactesting-faq/

      Backtest is built on the fly. If you are using a 5 min candle and a 30 min candle in your scans. Say at 10:15am, 30 min candle begins its formation, at 10:20am, the 5 min candle matches the scan conditions, now later at 10:30am, the 30 min candle also matches the scan conditions. In this case, you will not get an alert but the back-test will be populated for the 10.20am 5 min candle as this candle matched all scan conditions along with the current 30 min candle.

Leave a Reply

Your email address will not be published. Required fields are marked *