Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi-Time Frame code issue.

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

    #31
    Here's your problem:

    Code:
    if (Closes[1][0] > SMA(BarsArray[1], 100)[0]
                                && !HasTradedLong)[SIZE=6][COLOR=Red];[/COLOR][/SIZE]
    You can't semicolon close if-statements.
    Josh P.NinjaTrader Customer Service

    Comment


      #32
      Thanks.

      Josh, Thanks - now it appears to work.

      But why couldn't you tell me this yesterday when I first posted this code?

      Instead, you told me to read the article on adding a second time frame, which was definitely beneficial (even though I already read it before).
      If you had only noticed it yesterday - you would've saved me 8+ hours trying to fix something that wasn't broker, but something that was not used properly.

      Also, what do you mean a close if statement? It worked just fine prior to me adding the second time frame.

      Also, is there any way to set default values for the backtest box that opens up?

      Comment


        #33
        strategy1,

        If we saw it earlier we would have mentioned it earlier. Seeing something like that outside of a code editor is extremely hard. This is why we had you send us the zip file.

        By close an if-statement I mean placing a semicolon after the () of an if-statement.

        The default values that are settable are located here: http://www.ninjatrader-support2.com/...06&postcount=5
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

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