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

MultiData Series Range Bars

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

    MultiData Series Range Bars

    Hey Guys I uploaded a Simple Indicator I'm working on. Its purpose is to Plot a line on a 10 Tick (EUR/USD TenthOfAPiP) Chart, using the High or Low of 50 Tick Chart.

    It does plot a Line on the smaller Chart. But It's a One Bar Line.

    How do I make it Plot a Line From Beginning ("startX") to("endX") using the 50 tick Chart instead of 10 tick chart. I already have the startY endY working perfectly.

    Example of What I want is on the Right
    Example:
    Attached Files

    #2
    Hello ginx10k,

    Thank you for your inquiry.

    Rather than specifying an integer for your startX and endX values, you can use DateTime and utilize this DrawLine overload instead:
    Code:
    DrawLine(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, DashStyle dashStyle, int width);
    With this overload, you can obtain the times from your secondary Bars object and use this to determine the length of the line drawn.

    You'll be able to pull a DateTime using the Times collection: http://ninjatrader.com/support/helpG...nt7/?times.htm

    Please, let us know if we may be of further assistance.
    Zachary G.NinjaTrader Customer Service

    Comment


      #3
      I thought of that method before. But the Range Bar don't have a specific End Time nor Start Time. So I can't have a DateTime startTime,/endTime. Unless there is a specific way to Take the Closing of Previous Bar's Time Somehow?

      Any Thoughts?? Anyone??

      Comment


        #4
        Hello ginx10k,

        Utilizing the Times collection will return a DateTime object denoting the close of the bars.

        For instance, Times[1][0] will return the bar close time of the current bar of the secondary Bars object.

        For more information about using Times, please take a look at the NinjaTrader help guide at this link: http://ninjatrader.com/support/helpG...nt7/?times.htm

        Please, let us know if we may be of further assistance.
        Zachary G.NinjaTrader Customer Service

        Comment


          #5
          Any IDEA why This is NOT Working.

          I've uploaded a simple Script, and it does NOt draw rectangle. I dont' know why.

          I used one single condition for Multi Data Series Range Bar. and I'm testing on 6E 3 tick Range chart. using Default Settings
          Attached Files

          Comment


            #6
            Hello ginx10k,

            You need to be checking CurrentBar < 5 on both Bars objects.

            Example:
            Code:
            if (CurrentBars[0] < 5 || CurrentBars[1] < 5) // checks that we have at least 5 or more bars in BOTH Bars objects before continuing
                 return;
            Please, let us know if we may be of further assistance.
            Zachary G.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, 04-17-2024, 06:40 PM
            3 responses
            26 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by bmartz, 03-12-2024, 06:12 AM
            3 responses
            29 views
            0 likes
            Last Post NinjaTrader_Zachary  
            Started by Aviram Y, Today, 05:29 AM
            2 responses
            10 views
            0 likes
            Last Post Aviram Y  
            Started by gentlebenthebear, Today, 01:30 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by cls71, Today, 04:45 AM
            1 response
            7 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Working...
            X