Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

time strategies

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

    time strategies

    I can't create a strategy (using the wizard) that refers to a time.

    If I wanted to say, when time=9, place order, the wizard generates code that comes up with error:
    Cannot apply indexing with [] to an expression of type 'method group' Strategy\ar3.cs 49 29

    if (ToTime(Time[0]) == ToTime(21, 0, 0))
    {
    EnterShort(DefaultQuantity, "");
    }
    }

    Is the wizard generating the right syntax?

    Many thanks

    #2
    Can you provide exact steps on how to reproduce this?

    Thanks in advance.
    RayNinjaTrader Customer Service

    Comment


      #3
      Sure Ray,

      In condition builder, on the left, select time series, on the right, select time value, and enter the time, eg 22:00

      Comment


        #4
        Thanks.

        We just released 6.0.1000.5, could you install this version and see if this problem goes away? I recall something similar that I believe we resolved.

        To access the download, from within NT, select the menu Help > Download Site.
        RayNinjaTrader Customer Service

        Comment


          #5
          Hmmm... just did and get the same code:
          // Condition set 1
          if (ToTime(Time[0]) == ToTime(22, 54, 6))
          {
          EnterLong(DefaultQuantity,
          "");
          }
          }
          but the error message additionally says:

          The left-hand side of an assignment must be a variable, property or indexer Strategy\brek3.cs 44 16

          Am I doing this right?

          Comment


            #6
            Thanks, we will look into this.
            RayNinjaTrader Customer Service

            Comment


              #7
              In the meantime the proper syntax to check if time is 9am is this:
              Code:
              if (ToTime(Time[0]) == 90000)
              This reference sample demonstrates some of the ToTime() manipulations which you may find useful.
              Josh P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by triphop View Post
                I can't create a strategy (using the wizard) that refers to a time.

                If I wanted to say, when time=9, place order, the wizard generates code that comes up with error:
                Cannot apply indexing with [] to an expression of type 'method group' Strategy\ar3.cs 49 29

                if (ToTime(Time[0]) == ToTime(21, 0, 0))
                {
                EnterShort(DefaultQuantity, "");
                }
                }

                Is the wizard generating the right syntax?

                Many thanks
                Your code posted definitely compiles fine. Provided the error message you posted refers to the code lines you posted, I would think that your installation is screwed up.

                Please try this:
                - uninstall NT6
                - uninstall .NET 2.0 framework
                - install .NET 2.0 from here: http://www.microsoft.com/downloads/d...displaylang=en
                - reinstall NT6

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Pattontje, Yesterday, 02:10 PM
                2 responses
                14 views
                0 likes
                Last Post Pattontje  
                Started by flybuzz, 04-21-2024, 04:07 PM
                17 responses
                229 views
                0 likes
                Last Post TradingLoss  
                Started by agclub, 04-21-2024, 08:57 PM
                3 responses
                17 views
                0 likes
                Last Post TradingLoss  
                Started by TradingLoss, 04-21-2024, 04:32 PM
                4 responses
                43 views
                2 likes
                Last Post TradingLoss  
                Started by cre8able, 04-17-2024, 04:16 PM
                6 responses
                56 views
                0 likes
                Last Post cre8able  
                Working...
                X