Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Observation with BarsType

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

    Observation with BarsType

    Hello,

    I coded a custom bar type and noticed something I don't understand. A bar type contains the following method:

    publicoverridevoid Add(Bars bars, double open, double high, double low, double close, DateTime time, long volume, bool isRealtime)

    Inside this method I plot the parameters of Add() for debugging purpose. And as I use that bar type, Add() is called based on 1-minute-data. Please have a look at the print statements listed below. I highlighted two lines in red which indicate that the minute data in the range from 23:16:00 to 23:59:00 is provided twice by Add() and I did not expect that.

    Please note that the time gap between line 1 and 2 (23:01 - 23:15) is based on what IB provides as historical data for Forex pairs. My time zone is GMT+1.

    Regards
    Ralf


    ### bar time: 08.03.2011 23:00:00 open: 85,09 high: 85,095 low: 85,085 close: 85,09
    ### bar time: 08.03.2011 23:16:00 open: 85,065 high: 85,135 low: 85,065 close: 85,105
    ### bar time: 08.03.2011 23:17:00 open: 85,105 high: 85,105 low: 85,085 close: 85,085
    ### bar time: 08.03.2011 23:18:00 open: 85,085 high: 85,09 low: 85,085 close: 85,085
    ### bar time: 08.03.2011 23:19:00 open: 85,085 high: 85,1 low: 85,085 close: 85,095
    ### bar time: 08.03.2011 23:20:00 open: 85,095 high: 85,105 low: 85,085 close: 85,09
    ### bar time: 08.03.2011 23:21:00 open: 85,09 high: 85,095 low: 85,085 close: 85,095
    ### bar time: 08.03.2011 23:22:00 open: 85,095 high: 85,1 low: 85,09 close: 85,09
    ### bar time: 08.03.2011 23:23:00 open: 85,09 high: 85,095 low: 85,09 close: 85,09
    ### bar time: 08.03.2011 23:24:00 open: 85,09 high: 85,11 low: 85,09 close: 85,09
    ### bar time: 08.03.2011 23:25:00 open: 85,09 high: 85,11 low: 85,09 close: 85,11
    ### bar time: 08.03.2011 23:26:00 open: 85,11 high: 85,11 low: 85,1 close: 85,1
    ### bar time: 08.03.2011 23:27:00 open: 85,1 high: 85,11 low: 85,1 close: 85,105
    ### bar time: 08.03.2011 23:28:00 open: 85,105 high: 85,105 low: 85,1 close: 85,105
    ### bar time: 08.03.2011 23:29:00 open: 85,105 high: 85,11 low: 85,105 close: 85,11
    ### bar time: 08.03.2011 23:30:00 open: 85,11 high: 85,12 low: 85,105 close: 85,105
    ### bar time: 08.03.2011 23:31:00 open: 85,105 high: 85,105 low: 85,1 close: 85,105
    ### bar time: 08.03.2011 23:32:00 open: 85,105 high: 85,105 low: 85,085 close: 85,1
    ### bar time: 08.03.2011 23:33:00 open: 85,1 high: 85,105 low: 85,095 close: 85,105
    ### bar time: 08.03.2011 23:34:00 open: 85,105 high: 85,115 low: 85,095 close: 85,105
    ### bar time: 08.03.2011 23:35:00 open: 85,105 high: 85,105 low: 85,1 close: 85,1
    ### bar time: 08.03.2011 23:36:00 open: 85,1 high: 85,1 low: 85,095 close: 85,1
    ### bar time: 08.03.2011 23:37:00 open: 85,1 high: 85,1 low: 85,1 close: 85,1
    ### bar time: 08.03.2011 23:38:00 open: 85,1 high: 85,1 low: 85,1 close: 85,1
    ### bar time: 08.03.2011 23:39:00 open: 85,1 high: 85,115 low: 85,1 close: 85,105
    ### bar time: 08.03.2011 23:40:00 open: 85,105 high: 85,105 low: 85,105 close: 85,105
    ### bar time: 08.03.2011 23:41:00 open: 85,105 high: 85,11 low: 85,1 close: 85,11
    ### bar time: 08.03.2011 23:42:00 open: 85,11 high: 85,11 low: 85,095 close: 85,1
    ### bar time: 08.03.2011 23:43:00 open: 85,1 high: 85,1 low: 85,095 close: 85,095
    ### bar time: 08.03.2011 23:44:00 open: 85,095 high: 85,115 low: 85,095 close: 85,115
    ### bar time: 08.03.2011 23:45:00 open: 85,115 high: 85,12 low: 85,115 close: 85,12
    ### bar time: 08.03.2011 23:46:00 open: 85,12 high: 85,135 low: 85,12 close: 85,125
    ### bar time: 08.03.2011 23:47:00 open: 85,125 high: 85,125 low: 85,115 close: 85,115
    ### bar time: 08.03.2011 23:48:00 open: 85,115 high: 85,115 low: 85,11 close: 85,115
    ### bar time: 08.03.2011 23:49:00 open: 85,115 high: 85,115 low: 85,11 close: 85,115
    ### bar time: 08.03.2011 23:50:00 open: 85,115 high: 85,115 low: 85,11 close: 85,115
    ### bar time: 08.03.2011 23:51:00 open: 85,115 high: 85,115 low: 85,115 close: 85,115
    ### bar time: 08.03.2011 23:52:00 open: 85,115 high: 85,115 low: 85,1 close: 85,105
    ### bar time: 08.03.2011 23:53:00 open: 85,105 high: 85,115 low: 85,105 close: 85,115
    ### bar time: 08.03.2011 23:54:00 open: 85,115 high: 85,115 low: 85,115 close: 85,115
    ### bar time: 08.03.2011 23:55:00 open: 85,115 high: 85,115 low: 85,115 close: 85,115
    ### bar time: 08.03.2011 23:56:00 open: 85,115 high: 85,13 low: 85,115 close: 85,125
    ### bar time: 08.03.2011 23:57:00 open: 85,125 high: 85,135 low: 85,125 close: 85,135
    ### bar time: 08.03.2011 23:58:00 open: 85,135 high: 85,145 low: 85,135 close: 85,14
    ### bar time: 08.03.2011 23:59:00 open: 85,14 high: 85,14 low: 85,135 close: 85,135
    ### bar time: 08.03.2011 23:16:00 open: 85,065 high: 85,135 low: 85,065 close: 85,105
    ### bar time: 08.03.2011 23:17:00 open: 85,105 high: 85,105 low: 85,085 close: 85,085
    ### bar time: 08.03.2011 23:18:00 open: 85,085 high: 85,09 low: 85,085 close: 85,085
    ### bar time: 08.03.2011 23:19:00 open: 85,085 high: 85,1 low: 85,085 close: 85,095
    ### bar time: 08.03.2011 23:20:00 open: 85,095 high: 85,105 low: 85,085 close: 85,09
    ### bar time: 08.03.2011 23:21:00 open: 85,09 high: 85,095 low: 85,085 close: 85,095
    ......
    ### bar time: 08.03.2011 23:53:00 open: 85,105 high: 85,115 low: 85,105 close: 85,115
    ### bar time: 08.03.2011 23:54:00 open: 85,115 high: 85,115 low: 85,115 close: 85,115
    ### bar time: 08.03.2011 23:55:00 open: 85,115 high: 85,115 low: 85,115 close: 85,115
    ### bar time: 08.03.2011 23:56:00 open: 85,115 high: 85,13 low: 85,115 close: 85,125
    ### bar time: 08.03.2011 23:57:00 open: 85,125 high: 85,135 low: 85,125 close: 85,135
    ### bar time: 08.03.2011 23:58:00 open: 85,135 high: 85,145 low: 85,135 close: 85,14
    ### bar time: 08.03.2011 23:59:00 open: 85,14 high: 85,14 low: 85,135 close: 85,135

    #2
    Hello,

    Thanks for your forum post.

    Can you please post the line of code your using for the Add column when you call it. Your not by chance having multple calls for data are you?

    I look forward to assisting you further.

    Comment


      #3
      Hello Brett,

      not sure what you want to see. If you would provide me with an e-mail address, I could send you the whole bar type code.

      Regards
      Ralph

      Comment


        #4
        Hello,

        When you send the code in please insure that you send the bare minimum needed to reproduce the issue and also a reproducible scenario for me. I will setup the scenario and give it a quick look through to see if I can see a programming issue, expected behaivior, or otherwise.

        support at ninjatrader dot com ATTN: Brett and reference this forum post.

        I look forward to assisting you further.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by andrewtrades, Today, 04:57 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by chbruno, Today, 04:10 PM
        0 responses
        5 views
        0 likes
        Last Post chbruno
        by chbruno
         
        Started by josh18955, 03-25-2023, 11:16 AM
        6 responses
        436 views
        0 likes
        Last Post Delerium  
        Started by FAQtrader, Today, 03:35 PM
        0 responses
        7 views
        0 likes
        Last Post FAQtrader  
        Started by rocketman7, Today, 09:41 AM
        5 responses
        19 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X