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 cbadr, Today, 08:19 PM
        0 responses
        2 views
        0 likes
        Last Post cbadr
        by cbadr
         
        Started by DayTradingDEMON, Today, 07:23 PM
        0 responses
        6 views
        0 likes
        Last Post DayTradingDEMON  
        Started by XXfea, Today, 07:01 PM
        0 responses
        6 views
        0 likes
        Last Post XXfea
        by XXfea
         
        Started by RedPothos, Today, 05:07 PM
        0 responses
        11 views
        0 likes
        Last Post RedPothos  
        Started by JohnZee, Today, 04:14 PM
        0 responses
        7 views
        0 likes
        Last Post JohnZee
        by JohnZee
         
        Working...
        X