Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsArray - different timeframe

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

    BarsArray - different timeframe

    Hello,
    I have compiling erros when adding BarsArray to my code. I read the video library but here I donīt know whatīs wrong:

    if(Highs[1][1] < DonchianChannel(BarsArray[1],14).Upper[2]
    && GetCurrentBid(BarsArray[1])+ 2*TickSize>DonchianChannel(BarsArray[1],14).Upper[1]
    && Opens[1][0] < Closes[1][0])

    Thanks for any help.

    Best
    Tony
    Last edited by tonynt; 08-07-2010, 08:13 AM. Reason: error typing

    #2
    I would suggest quoteing the errors seen in the control centre log tab, and also trying the code without the barsarrays to see if the issue is with the logic first.

    Goodluck!

    Jon

    Comment


      #3
      BarsArray - different timeframe

      Jon,

      thanks for your reply. Yourīre right 100%. Of course Iīve done without BarsArray. I do this condition in basic timeframe and I just wanted to add this condition in higher timeframe (as I have added already other conditions in different timeframes). But here it doesnīt work. I donīt see where there should be maybe a "[]" or "," or "()" or " ".

      Thanks
      Tony

      Originally posted by Trader.Jon View Post
      I would suggest quoteing the errors seen in the control centre log tab, and also trying the code without the barsarrays to see if the issue is with the logic first.

      Goodluck!

      Jon

      Comment


        #4
        tonynt, we'll actually need the error to help you out here. You can find the error in the log tab of Control Center (right-most tab). Please let us know what you find, and I'll suggest a course of action after that. Thank you.
        AustinNinjaTrader Customer Service

        Comment


          #5
          barsarray

          Austin,

          thank you for your reply.

          In the log-tab I find incorrect strategy-coding (when strategy can not be compiled and saved - because of error in coding)?? I donīt see there.

          Best
          Tony

          Originally posted by NinjaTrader_Austin View Post
          tonynt, we'll actually need the error to help you out here. You can find the error in the log tab of Control Center (right-most tab). Please let us know what you find, and I'll suggest a course of action after that. Thank you.

          Comment


            #6
            Tony, I'm not exactly sure what error that is. Can you please copy + paste the entire text of the error? Thank you.
            AustinNinjaTrader Customer Service

            Comment


              #7
              Thanks for you reply. I still donīt know why the error within the coding should appear in the log-tabs with system errors. But however, the error was the "GetCurrentBid) and I have changed to "closes" - which of course works. This is I was asking for: as in the current timeframe itīs called eg "close" and in added timeframe itīs "closes" what this would be for "GetCurrentBid" in added timeframe. Maybe you can answer this.
              Best
              Tony

              Comment


                #8
                Originally posted by tonynt View Post
                Hello,
                I have compiling erros when adding BarsArray to my code. I read the video library but here I donīt know whatīs wrong:

                if(Highs[1][1] < DonchianChannel(BarsArray[1],14).Upper[2]
                && GetCurrentBid(BarsArray[1])+ 2*TickSize>DonchianChannel(BarsArray[1],14).Upper[1]
                && Opens[1][0] < Closes[1][0])

                Thanks for any help.

                Best
                Tony
                it should be GetCurrentBid()
                or GetCurrentBid(1); // 1 = secondary series; 0 = primary series and so on

                BarsArray[1] is Bars and not an int, which the overload supports.

                Comment


                  #9
                  Thank you!

                  Originally posted by bukkan View Post
                  it should be getcurrentbid()
                  or getcurrentbid(1); // 1 = secondary series; 0 = primary series and so on

                  barsarray[1] is bars and not an int, which the overload supports.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  649 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  370 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  109 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  574 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  576 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X