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

If this is set to a 1 minute chart why would I get 2 minute spacing

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

    If this is set to a 1 minute chart why would I get 2 minute spacing

    If this code is set to a 1 minute chart why would I get 2 minute spacing.

    What I am trying to do is to double check if the following bar minute differential is the same. I need to do some ray drawing and my lines will be skewed if the following bar is not the correct time. Examples are 15 minute spacing before close on nq , 1 hour close and weekends.


    basically if the bar spacing is equal draw the ray and if not adjust the Anchor accordingly


    nCurrentBar = Bars.GetBar(tTempTime1);
    tNextBarTime = Bars.GetTime(nCurrentBar+1);

    Print(tTempTime1 + " this is the tTempTime1");
    Print(tNextBarTime + "This is the next Time"


    my result in a 1 minute chart

    2017-11-29 1:43:00 AM this is the tTempTime1
    2017-11-29 1:45:00 AMThis is the next Time
    2017-11-29 3:18:00 AM this is the tTempTime1
    2017-11-29 3:20:00 AMThis is the next Time

    2017-11-29 4:56:00 AM this is the tTempTime1
    2017-11-29 4:57:00 AMThis is the next Time

    2017-11-29 6:31:00 AM this is the tTempTime1
    2017-11-29 6:33:00 AMThis is the next Time

    #2
    Hello ballboy11,

    Thank you for your response.

    What is tTempTime1 set by?

    I look forward to your response.

    Comment


      #3
      I have a list of times within a List so tTemptime extracts the timestamp from the list

      Comment


        #4
        Hello ballboy11,

        Thank you for your response.

        And if you call CurrentBar here and CurrentBar+1 directly (not through a list), do you see the same behavior?

        I look forward to your response.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by kujista, Today, 06:23 AM
        4 responses
        12 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by traderqz, Yesterday, 09:06 AM
        2 responses
        15 views
        0 likes
        Last Post traderqz  
        Started by traderqz, Today, 12:06 AM
        3 responses
        6 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X