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

Trying to create a shift+mouse click order entry but keep having errors

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

    Trying to create a shift+mouse click order entry but keep having errors


    I am trying to create an Add-On that would allow me to place order with shift+mouse click. The code is too long so for some reasons i can't do wrap. But this is the link i created on Pastebin.
    Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.


    The error messages are follows. How to resolve the errors? Please help.
    NinjaScript File Error Code Line Column
    Mouseclickorder.cs The type or namespace name 'AddOnBase' does not exist in the namespace 'NinjaTrader.NinjaScript.AddOns' (are you missing an assembly reference?) CS0234 26 67
    Mouseclickorder.cs The type or namespace name 'Attributes' does not exist in the namespace 'NinjaTrader.NinjaScript.AddOns' (are you missing an assembly reference?) CS0234 19 38
    Mouseclickorder.cs The type or namespace name 'NinjaScriptAddon' could not be found (are you missing a using directive or an assembly reference?) CS0246 25 6
    Mouseclickorder.cs The type or namespace name 'NinjaScriptAddonAttribute' could not be found (are you missing a using directive or an assembly reference?) CS0246 25 6



    #2
    Hello Realiori9999,

    It looks like you have invalid code in this file. The namespace used for the inheritance is not correct, NinjaScriptAddon and NinjaScriptAddonAttribute are note types that exists in NinjaScript. Additionally based on the errors you are also missing some using statements.

    I would suggest to exclude this script from compilation so you can get back to a compiled state, then right click the addon folder -> new addon and generate it. That will show the current addon class structure and using statements so it compiles.

    After that you can re create your code in the new addon file so its valid.
    JesseNinjaTrader Customer Service

    Comment


      #3
      thank you. Now I have learnt that ChatGPT is incompetent in programming ninjascript.

      Comment


        #4
        Hello Realiori9999,

        Yes at this time that is not a smart enough tool to understand the context of NinjaScript. For getting started with interacting with a window from an addon I would suggest looking at the following link. Addons have window created events that need to be used if you plan to add to a window when its opened the AddMenuItemFromAddon.zip


        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by port119, 04-27-2024, 02:43 PM
        3 responses
        30 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by sastrades, 01-31-2024, 10:19 PM
        13 responses
        203 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by reynoldsn, Today, 04:40 PM
        0 responses
        4 views
        0 likes
        Last Post reynoldsn  
        Started by Philippe56140, 04-27-2024, 02:35 PM
        6 responses
        54 views
        0 likes
        Last Post bltdavid  
        Started by ETFVoyageur, Yesterday, 06:05 PM
        7 responses
        45 views
        0 likes
        Last Post ETFVoyageur  
        Working...
        X