• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Operator '>=' cannot be applied to operand?

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

    Operator '>=' cannot be applied to operand?

    Hello NT Support
    Can't figure out how to fix this error. Screen shot enclosed.
    Thanks
    Attached Files

    #2
    Hello thinkster,

    To better assist you could you send a me a copy of your strategy so that I can take a quick look at it.

    Send to Support[AT]NinjaTrader[DOT]Com, please attach the strategy by going to (My) Documents -> NinjaTrader 7 -> bin -> Custom -> Strategy, there you will find the name of your strategy with a '.cs' at the end.

    In the body please put: "ATTN: JC" with a link to this thread.

    Happy to be of further assistance.
    JCNinjaTrader Customer Service

    Comment


      #3
      Originally posted by thinkster View Post
      Hello NT Support
      Can't figure out how to fix this error. Screen shot enclosed.
      Thanks
      ToTime() requires a DateTime argument. Your argument is just a set of integers.

      Comment


        #4
        Thanks Kogonam
        Not sure what a 'datetime argument' is. This condition is unlocked script from the Strat. Wizard. It worked okay until code was unlocked. Sorry, new at this. Can you give an example: Just want to set when trading starts and stops.

        Comment


          #5
          Originally posted by thinkster View Post
          Thanks Kogonam
          Not sure what a 'datetime argument' is. This condition is unlocked script from the Strat. Wizard. It worked okay until code was unlocked. Sorry, new at this. Can you give an example: Just want to set when trading starts and stops.
          That depends on what you want to do. ToTime() takes a DateTime variable for argument and returns an integer. So if you wanted to use 7:00 AM as a gating time, you would write it as an integer too.

          e.g, if (ToTime(Time[0]) >= 70000) ...

          Comment


            #6
            Hello thinkster,

            Syntactically, it does not look like there is anything wrong with the statement:
            Code:
            if ( ToTime(Time[0]) >= ToTime(7,0,0)
            	&& ToTime(Time[0]) <= ToTime(16, 0 ,0)
            	&& CrossBelow(Close, Bollinger(Standev, BbPeriod).Lower, 1))
            Unless one of the variables: “Standev” or “BbPeriod” has a problem. If this code was generated from the Strategy Wizard there should be no problem with this but any custom code that was added may have an error. Sometimes compiling errors show different lines if there is an error.

            You can follow the steps in the following forum post to go through and debug your code to find the error that is causing this issue.
            http://www.ninjatrader.com/support/f...ead.php?t=3418

            I can still take a quick look at your code to see if I can point you in the right direction if you want to send in your code to me by following the steps in post 2.

            Please let me know if I can be of further assistance.
            JCNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_JC View Post
              Hello thinkster,

              Syntactically, it does not look like there is anything wrong with the statement:
              Code:
              if ( ToTime(Time[0]) >= ToTime(7,0,0)
                  && ToTime(Time[0]) <= ToTime(16, 0 ,0)
                  && CrossBelow(Close, Bollinger(Standev, BbPeriod).Lower, 1))
              Unless one of the variables: “Standev” or “BbPeriod” has a problem. If this code was generated from the Strategy Wizard there should be no problem with this but any custom code that was added may have an error. Sometimes compiling errors show different lines if there is an error.

              You can follow the steps in the following forum post to go through and debug your code to find the error that is causing this issue.
              http://www.ninjatrader.com/support/f...ead.php?t=3418

              I can still take a quick look at your code to see if I can point you in the right direction if you want to send in your code to me by following the steps in post 2.

              Please let me know if I can be of further assistance.
              Mea Culpa. I did not see the otherwise undocumented override in Intellisense. That will teach me to keep my big mouth shut!

              Comment


                #8
                We thank you for all of your help koganam. I submitted the overload to be added to our Help Guide as well for ToTime().
                JCNinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Vps by stooby
                Started by stooby, Today, 08:32 PM
                0 responses
                2 views
                0 likes
                Last Post stooby
                by stooby
                 
                Started by FaaastEddy, Today, 08:25 PM
                0 responses
                3 views
                0 likes
                Last Post FaaastEddy  
                Started by YevhenShynkarenko, Yesterday, 01:22 AM
                2 responses
                38 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by testingsarasa, 05-20-2018, 02:50 PM
                11 responses
                733 views
                0 likes
                Last Post NinjaTrader_ChelseaB  
                Started by martyn73, Today, 05:27 PM
                2 responses
                9 views
                0 likes
                Last Post martyn73  
                Working...
                X