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

error CS0118 NinjaTrader.NinjaScript.Indicators.SMA is a type, but used as variable.

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

    error CS0118 NinjaTrader.NinjaScript.Indicators.SMA is a type, but used as variable.

    Hello, I am implementing indicator.
    And I get error everywhere , when I compare close[0] and value of SMA() indicator.
    What can be a problem?

    The weird is that when I am using indicator - everything is fine.!
    But when I try to export I get error in log file.


    Code:
    private bool current_trend_filter(AkSignalType signal_type)
            {
                bool result = true;
                switch (signal_type) {
                    case AkSignalType.Buy:
                        if (Close[0] < SMA(SlowSMAPeriod)[0])
                            result = false;
                        break;
                    case AkSignalType.Sell:
                        if (Close[0] > SMA(SlowSMAPeriod)[0])
                            result = false;
                        break;
                }
    
                return result;
            }

    #2
    Hello akushyn,
    Thanks for your post.

    The issue does not appear to be with any NinjaScript in this snippet.

    If you exclude this script from compilation are you able to export?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_JoshG View Post
      Hello akushyn,
      Thanks for your post.

      The issue does not appear to be with any NinjaScript in this snippet.

      If you exclude this script from compilation are you able to export?
      Hello, JoshG

      Thank you for the quick reply.
      So far, I have no other scripts in the scope.

      Could it be the issue with VirtualBox running NT8 export?

      Comment


        #4
        I've just tried .... create copy-paste SMA indicator as my custom indicator to try exporting the script.
        But indicator is avaliable only in Script Editor and not visible to add on chart or export.

        See attached picture.

        Comment


          #5
          akushyn,

          Your NinjaScript does not appear in the Indicators window because of your "Name" property inside OnStateChange()

          Can you find the NinjaScript once you change that property to the name you expect to find it under?
          Josh G.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_JoshG View Post
            akushyn,

            Your NinjaScript does not appear in the Indicators window because of your "Name" property inside OnStateChange()

            Can you find the NinjaScript once you change that property to the name you expect to find it under?
            When I comment Description and Name properties the indicator appears in the list.


            And I think it is a BUG with general question about exporting ERROR - can't export scripts from Virtual Machine.

            I've just copied to another notebook with Windows7 (not a virtual drive) and export works like a sharm.
            So, may be you can advise me some topics, how to run NinjaTrader8 on Linux Mint 19 ?

            Comment


              #7
              akushyn, I do not believe that this is a bug. I am able to compile my own custom method just fine when using the same logical comparison. ( Close[0] < SMA(SlowSMAPeriod)[0] )

              Linux is not supported by NinjaTrader, but I can submit your vote towards the open request for Linux support. The internal tracking number for that feature request is SFT-153. Please reference this internal tracking number if you ever have questions regarding this feature request.

              When a feature request is implemented, you'll find it in the release notes:



              Additionally, please write in to PlatformSupport(AT)NinjaTrader(DOT)com and reference this forum post with RE:JOSH in the subject line. Please attach your Log and Trace files to your email so that I may investigate this matter further. You may follow the steps below to attach those files.
              • Open your NinjaTrader folder under My Documents.
              • Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
              • Send the 2 compressed folders as attachments to this email.
              • Once complete, you can delete these compressed folders.


              Josh G.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by mgco4you, Today, 09:46 PM
              1 response
              3 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by wzgy0920, Today, 09:53 PM
              0 responses
              4 views
              0 likes
              Last Post wzgy0920  
              Started by Rapine Heihei, Today, 08:19 PM
              1 response
              8 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by Rapine Heihei, Today, 08:25 PM
              0 responses
              6 views
              0 likes
              Last Post Rapine Heihei  
              Started by f.saeidi, Today, 08:01 PM
              1 response
              9 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X