Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

triangles arent plotting

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

    #16
    Originally posted by simpletrades View Post
    i just tried your suggestion in post 10.

    i added this
    if (CurrentBar < 1)
    return;

    this made the simplified line work when the current bar was higher than the prior bar, but when i deleted that sample line and reinserted my real 3 parts of condition 1, it didnt work.
    i tried each of my 3 parts of cond 1 alone and only this last line worked when by itself
    if (Low[0] > Low[1]-1.0)

    neither of these other 2 lines worked alone as the if statement--ignore the lack of parentheses in these.

    Low[2] <= Low[3]+.25
    High[1] >= High[2]+.5


    is it anything to do with the fact that in the 2 lines that dont work, both tested bars are not the current bar but instead are 1 or 2 or 3 back but in the line that did, one is Low[0]--the current bar?

    THAT IS THE PROBLEM because when i change those nonworking lines to always compare just bar[0] with bar[1] for the comparison highs or lows, they worked together.
    So how does it get fixed?
    Last edited by simpletrades; 03-27-2010, 09:28 PM.

    Comment


      #17
      i thought about it and went in and changed this to read 4 bars instead of just 1 since the furthest back i tell it to go to compare lows is 3 bars but i might want another filter later.
      and it works. thanks.

      if (CurrentBar < 4)
      return;

      Comment


        #18
        Originally posted by simpletrades View Post
        i thought about it and went in and changed this to read 4 bars instead of just 1 since the furthest back i tell it to go to compare lows is 3 bars but i might want another filter later.
        and it works. thanks.

        if (CurrentBar < 4)
        return;
        now can you help me filter out repeat triangles 2 bars in a row?
        i want it to read as another requirement of my 'condition set 1' that the condition one bar ago=false or something. here is the relevant part of the current code.

        protectedoverridevoid OnBarUpdate()
        {
        if (CurrentBar < 4)
        return;
        //Condition set 1

        if (Low[2] <= Low[3]+.25
        && High[
        1] >= High[2]+.5
        && Low[
        0] > Low[1]-1.0)

        {
        DrawTriangleUp etc......

        Comment


          #19
          Hi

          A few options...
          1. You designate a to have the new triangle automatically delete the old object and redraw it by naming the new object with the same same, by removing the "+ CurrentBar" in the tag name

          Code:
          DrawTriangleUp("My triangle up", false, 0, Low[0]- (TickSize*dist), Color.Lime)
          instead of
          Code:
          DrawTriangleUp("My triangle up" + CurrentBar, false, 0, Low[0]- (TickSize*dist), Color.Lime)
          or you can remove specific objects by their name with RemoveDrawObject()

          More info at - http://www.ninjatrader-support.com/H...moveDrawObject
          TimNinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_Tim View Post
            Hi

            A few options...
            1. You designate a to have the new triangle automatically delete the old [/code]

            or you can remove specific objects by their name with RemoveDrawObject()

            More info at - http://www.ninjatrader-support.com/H...moveDrawObject
            thats the opposite way. i want the second consecutive triangle to not appear, not to delete the earlier one.

            Comment


              #21
              Hi simpletrades,

              You can create a condition that looks back an extra bar, (Low[3] instead of Low[2] for example) then use the RemoveDrawObject()

              Unfortunately, I can not write the specific code logic for you.
              TimNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by sugalt, 04-30-2024, 04:02 AM
              3 responses
              14 views
              0 likes
              Last Post NinjaTrader_Zachary  
              Started by Trader146, 03-29-2024, 01:22 PM
              5 responses
              28 views
              0 likes
              Last Post NinjaTrader_RyanS  
              Started by tkaboris, Today, 08:32 AM
              1 response
              4 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              178 responses
              2,409 views
              0 likes
              Last Post NinjaTrader_BrandonH  
              Started by betsuni_123, Yesterday, 04:20 PM
              4 responses
              23 views
              0 likes
              Last Post betsuni_123  
              Working...
              X