Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Added Kagi series

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Added Kagi series

    I added a kagi data series to a strategy and found that the strategy executions live lag the backtest by the same period as the kagi series (a 5 minute kagi series yielded trades occuring live 5 minutes after they would in the backtest). I added print(Times[1][0] and Times[0][0]) and saw this:

    10/25/2024 9:55:00 AM 10/25/2024 10:01:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:02:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:03:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:04:00 AM
    Enabling NinjaScript strategy
    10/25/2024 9:55:00 AM 10/25/2024 10:05:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:06:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:07:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:08:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:09:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:10:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:11:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:12:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:13:00 AM
    10/25/2024 9:55:00 AM 10/25/2024 10:14:00 AM
    10/25/2024 10:10:00 AM 10/25/2024 10:15:00 AM
    10/25/2024 10:10:00 AM 10/25/2024 10:16:00 AM
    10/25/2024 10:10:00 AM 10/25/2024 10:17:00 AM
    10/25/2024 10:10:00 AM 10/25/2024 10:18:00 AM
    10/25/2024 10:10:00 AM 10/25/2024 10:19:00 AM

    It appears the kagi bar times lag the live by 5 minutes - why is this and how to avoid this from happening?​

    #2
    Hello samish18,

    In a backest executions are always seen on the following bar from where the condition was true due to how fills are processed.

    Comment


      #3
      That does not answer my question about why the Kagi time series (at least nominally) lags in real time. I understand how backtest executions work.

      Comment


        #4
        Hello samish18,

        Its possible that is due to the conditions you are using, you could use prints to explore how the conditions are evaluating between each test.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Working...
        X