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

Can't get a particular bar to compare. Please help.

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

    Can't get a particular bar to compare. Please help.

    In the attached code I can get the code to compare in BuySeqCount == 12, the 13th bar vs the 8th bar BUT in BuySeqCount == 7, I can't get the 8th bar to compare with the 5th!!! The relevant method is "ProcessBuySequential"

    Would anyone mind taking a look and tell me what I am doing wrong? Thanks!
    Attached Files

    #2
    Kay, please add Prints to the code at those relevant sections to check if those conditions actually trigger as you expect.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      Upon printing the values, the values that I thought I had stored changes. For example buycountdown8 = Close[0]; this is a private double variable.

      But after a few bars, the value of buycountdown8 changes.

      How am I able to store this value so that it doesn't change?

      Comment


        #4
        This is expected as you can have multiple occurences on the chart where the condition is true, thus storing this value again and again...so you would only see the most recent one stored. You could use a dataseries for this, thus storing the history of values. By then retrieving past values with the index you're able to access past and current values in your calcs.

        BertrandNinjaTrader Customer Service

        Comment


          #5
          Hi Bertrand,
          I am aware that I have multiple occurences of for example buycountdown8 on the chart but the 13 red counts are preceded by 9 green counts in every case. without the 9 green counts, the 13 red counts do not exist. the comparison of the 13th red count vs the 8th red count will be done on every occassion.

          the storage of the value (in this case buycountdown8) shouldn't move within each set and I didn't expect it to do so with a few bars.

          if i were to take up your suggestion to use the DataSeries Class, how would i be able to call up buycountdown8 for example?

          Comment


            #6
            You can access whichever [] index would relate to that bar.

            [0] is most recent, [1] is previous, etc. Just like how you access Close prices.
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi Josh,
              Each set of 9 green counts (consecutive counts) is matched by a set of 13 red counts (not necessarily consecutive counts). And because the red counts do not occur predictably, my first thoughts were to capture the values of the 5th and the 8th count as and when they occured by storing the value as a private double. I would be capturing these 2 values for each set of red counts. I thought that by resetting those values at the completion of the red counts would suffice. Thought it would have been quite straight forward. What I did not expect was the private double values to have their values changed within a few bars. Without the consistency in the position of the red counts, I thought it would be difficult to call up the 5th and the 8th count. I've attached 2 charts to display the unpredictability of the counts and locking in the value as and when it occurs seems the best option. Appreciate any further advice/guidance.
              Attached Files

              Comment


                #8
                Kay, unfortunately we can't really debug this for you - best approach would be simplifying the codes as much as possible and then first checking into why the counting behaves as 'unpredictable' as you noted. Then work on from there after fixing / determining this, as this would also influence then how you should save those values for later reference in your code. A dataseries would have the convenience of offering access to all past values, but of course it adds resource needs as well to store those.
                BertrandNinjaTrader Customer Service

                Comment


                  #9
                  Hi Bertrand,

                  I understand what you are trying to say. I have close to zero programming knowledge and have been picking bits and pieces from you, Josh and the guys who help out on this forum like Baruch and on another forum. I thought the code was pretty simplified as it is. The 9 green counts is the backbone while the rest are indicators that are created as a result of the 9 count completion. If I were to break it up into separate indicators, and call them up as required, would that help? Or would it be simpler to try to recode it? This is actually the last bit for the indicator (comparing the 8 v 5 count and 13 v 8 count). I have seen something similar to this indicator in the forum and have been using it as a guide. Unfortunately, it has taken me as far as it could...

                  The other issue is having the Buy indicator and Sell indicator under one code. If I were to put them under one "umbrella" as opposed to combining them in one code, would that work better?

                  I remember having an indicator which calculated 2 SMAs in one indicator. It was disastrous! I separated them and it looked great!

                  Comment


                    #10
                    Kay, I can understand - rewriting from scratch might be the best learning experience if you're ready to spent some time on it, with the code you got from the forum it sometimes needs a fair amount of time to understand 3rd party code thus my suggestion to simplify as much as possible to understand its action from the ground up, this way you can Print values and see where you hit unexpected outcomes along the way.

                    If you want this to be fixed for you so you can review and learn from the final working code, a consultant might be the most efficient way to proceed -

                    BertrandNinjaTrader Customer Service

                    Comment


                      #11
                      Hi Bertrand,

                      I'm trying to have an extra condition before an "8' is printed but the code prints both a "+" on the "7" (so where the "7" is printed, a "+" is printed on top of it) when the condition is not fulfilled and continues with an "8".

                      What I would like to do is for the code to print a "+" instead of an "8" when the condition is not fulfilled and to print an "8" when the condition is fulfilled. How would I go about doing that? Everything else in the code is working fine.

                      This is what I've done so far:-
                      Code:
                      [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]<=Low[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]2[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]])[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (BuySeqCount < [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]12[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]) [/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                      [SIZE=2][FONT=Courier New]BuySeqCount++;[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].TDBuySeqDrawText(BuySeqCount.ToString());[/SIZE][/FONT]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (BuySeqCount == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]5[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                      [SIZE=2][FONT=Courier New]buycountdown5 = Close[[/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]];[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"buycountdown5 is"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]].ToString());[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// to qualify for the 8th count[/COLOR][/SIZE][/FONT]
                      [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (BuySeqCount == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]7[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Low[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]] <= buycountdown5)[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]{[/FONT][/SIZE]
                      [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Low of 8 is"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + Low[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]Print([/FONT][/SIZE][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"buycountdown5 is"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + buycountdown5);[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]BuySeqCount++;[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].TDBuySeqDrawText(BuySeqCount.ToString());[/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][/FONT]
                      [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]{[/SIZE][/FONT]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].TDBuySeqDrawText([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"+"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]); [/SIZE][/FONT]
                      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                      [SIZE=2][FONT=Courier New]}[/FONT][/SIZE]
                      [/SIZE][/FONT][FONT=Courier New][SIZE=2]
                      [/SIZE][/FONT]
                      Last edited by kaywai; 03-08-2010, 03:02 AM.

                      Comment


                        #12
                        This code continues from the earlier part:-

                        Code:
                        [FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (BuySeqCount == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]8[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])
                        {
                        buycountdown8 = Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]];
                        Print([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"buycountdown8 is"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + Close[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]].ToString());
                        }
                        }
                        [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000][FONT=Courier New][SIZE=2][COLOR=#008000]// to qualify for the 13th count
                        [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2][/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]else[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (BuySeqCount == [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]12[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2])
                        {
                        [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]if[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] (Low[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]] <= buycountdown8)
                        {
                        Print([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"Low of 13 is"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + Low[[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]0[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]]);
                        Print([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"buycountdown8 is"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] + buycountdown8);
                        BuySeqCount++;
                        [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].TDBuySeqDrawText(BuySeqCount.ToString());
                        [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].InitializeNewBuySeqCountdown();
                        }
                        [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]else
                        [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]{
                        [/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]this[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2].TDBuySeqDrawText([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000][FONT=Courier New][SIZE=2][COLOR=#800000]"+"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]);
                        }
                        } 
                        }
                        
                        }
                        [/SIZE][/FONT][/SIZE][/FONT]

                        Comment


                          #13
                          Kay, unfortunately I can't debug this custom code for you - if I were you I would further simplify the code and test each single value / method as noted before. The code will do exactly what you tell it to do - also for the count on each OnBarUpdate as you've implemented it, it would be advisable to run on CalculateOnBarClose = true.
                          BertrandNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by bortz, 11-06-2023, 08:04 AM
                          47 responses
                          1,602 views
                          0 likes
                          Last Post aligator  
                          Started by jaybedreamin, Today, 05:56 PM
                          0 responses
                          8 views
                          0 likes
                          Last Post jaybedreamin  
                          Started by DJ888, 04-16-2024, 06:09 PM
                          6 responses
                          18 views
                          0 likes
                          Last Post DJ888
                          by DJ888
                           
                          Started by Jon17, Today, 04:33 PM
                          0 responses
                          4 views
                          0 likes
                          Last Post Jon17
                          by Jon17
                           
                          Started by Javierw.ok, Today, 04:12 PM
                          0 responses
                          12 views
                          0 likes
                          Last Post Javierw.ok  
                          Working...
                          X