Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.


            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.


              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
                Started by rdtdale, Today, 01:02 PM
                0 responses
                1 view
                0 likes
                Last Post rdtdale
                by rdtdale
                 
                Started by alifarahani, Today, 09:40 AM
                3 responses
                15 views
                0 likes
                Last Post NinjaTrader_Jesse  
                Started by RookieTrader, Today, 09:37 AM
                4 responses
                18 views
                0 likes
                Last Post RookieTrader  
                Started by PaulMohn, Today, 12:36 PM
                0 responses
                6 views
                0 likes
                Last Post PaulMohn  
                Started by love2code2trade, 04-17-2024, 01:45 PM
                4 responses
                40 views
                0 likes
                Last Post love2code2trade  
                Working...
                X