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 Hwop38, 05-04-2026, 07:02 PM
        0 responses
        161 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        309 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        245 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        349 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        179 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X