• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multiple Patterns

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

    Multiple Patterns

    Hello,

    I have been for at a road block with an indicator and I on the hunt to create Multiple Patterns on a Chart Simultaneously.
    Given a New Code of...

    OnBarUpdate()
    {
    DrawTriangle("Triangle", true, 0, High[0], -1, Low[-1], -2, High[-2], Color.White, Color.White, 1);
    DrawTriangle("Triangle", true, 0, High[0], -2, Low[-2], -4, High[-4], Color.White, Color.White, 1);
    }

    Where the CurrentBar will print to the Right Every other or Ever two Candles.
    I have the Suspicion that the Code is ONLY printing the MOST updated Pattern. (i.e. the Lower One.)
    Any Ideas will be greatly appreciated.

    #2
    Originally posted by Timothy_Miller View Post
    Hello,

    I have been for at a road block with an indicator and I on the hunt to create Multiple Patterns on a Chart Simultaneously.
    Given a New Code of...

    OnBarUpdate()
    {
    DrawTriangle("Triangle", true, 0, High[0], -1, Low[-1], -2, High[-2], Color.White, Color.White, 1);
    DrawTriangle("Triangle", true, 0, High[0], -2, Low[-2], -4, High[-4], Color.White, Color.White, 1);
    }

    Where the CurrentBar will print to the Right Every other or Ever two Candles.
    I have the Suspicion that the Code is ONLY printing the MOST updated Pattern. (i.e. the Lower One.)
    Any Ideas will be greatly appreciated.
    Your triangles have the same tag, so the last one will overwrite any others. Make your tags unique.

    The syntax in the NTHelp states this rather clearly.



    ref: http://www.ninjatrader.com/support/h...awtriangle.htm
    Attached Files
    Last edited by koganam; 12-17-2014, 11:58 AM.

    Comment


      #3
      Hello Timothy,

      koganam is correct in his reply -- as long as you are using the same tag for both triangles, the second one will always update the first one, rather than drawing a new triangle.

      However, I will add this to koganam's reply: In order to assign a unique tag to each triangle, you will need to find a way to assign a value that can be updated on each bar. For example, something like ("Triangle" + CurrentBar) will result in unique tags that include the current bar number ("Triangle233," Triangle234," etc.).

      Please let me know if I can assist further.
      Dave I.NinjaTrader Product Management

      Comment


        #4
        Dear NinjaTrader_David and koganam,

        Both of your ideas have worked and I am still amazed at how it was such a simple fix.
        Also I have the DrawTriangle() in a for() Loop and prints different Values for each point.
        Again, thank you very much.

        Simplified version...

        for (...)
        {
        DrawTriangle("Triangle1" + CurrentBar, ...)
        DrawTriangle("Triangle2" + CurrentBar, ...)
        }

        I am using a pair of triangles for each successful loop.
        Timothy Miller
        Last edited by Timothy_Miller; 12-17-2014, 09:22 PM.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by digibob, Today, 02:47 AM
        2 responses
        13 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by mntemel, Today, 03:31 PM
        0 responses
        1 view
        0 likes
        Last Post mntemel
        by mntemel
         
        Started by mrlucky1x, Today, 03:14 PM
        0 responses
        1 view
        0 likes
        Last Post mrlucky1x  
        Started by ninjo, Today, 02:42 PM
        3 responses
        5 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Longhornmark, Today, 01:13 PM
        7 responses
        17 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X