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

Easy language to C# for Ninja Trader

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

    Easy language to C# for Ninja Trader

    I am BRAND SPANKING NEW to ninja trader. I am going to explain what I need to do.

    1. I have some Easy language indicators (Easy language is the prop language for TradeStation) that I sell. i am very small time.

    2. I would like to convert these indicators to C# to use with Ninja trader.

    3. I would like them to be pure C# code with NO ninja trader code.

    4. WHY? Because I can then translate them to Java and then they can be used by multiple companies that support indicator development in Java. Such as Interactive Brokers.

    5. If I mix ninja trader code with the C# code, the moving them to Java will be, well, ten times harder.

    6. I have built, and there are multiple programs that convert c# to java beautifully

    Can this be done and could anyone lead me to a place where I could learn how to do this. Examples are of course the best way for anyone.

    7. How much will I really use the .NET environment. You see, I am totally confused how the .NET, c#, and Ninja Trader platform work together

    #2
    Welcome to our forums wcranes - NinjaScript is just a subset of methods / functions working to simpify the coding process for trading related scripts - http://www.ninjatrader-support.com/H...verview17.html

    If you want to be able to easily adapt to various platforms, you should consider calculating your proprietary logic for example in DLL file and then calling this from NinjaScript to be able to add the strategy related execution logic to automate trading the signals generated.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Let me get this straight. I basically create my own API via C# that does the main logic. Then I use ninja script as an interface that calls my API to actually place the logic on the screen. Whether I use a dll file or not is not my main concern. To be honest I am new to C# and the .NET framework. And Ninja script. I am not going into my education and programming background, but lets just say this is simple project compared to my experience. But when facing anything new, you at minimum want to start down the right path. So this creates my other questions:

      1. I use .NET framework to code the logic via C#
      2. I use Ninja Script to call my logic
      3. I then will of course show on the screen

      This is repetitive but i want to make sure I use the right steps:

      So lets say I wanted to create my first indicator. I would go to the .NET framework and code the logic. I create a DLL, and then go to the Ninja Script IDE, then call and basically test my logic.

      Comment


        #4
        That was basically the idea, as the DLL makes your calculation logic portable - please also keep in mind creating this completely in NinjaScript is likely more straightforward for you and you could also connect to various brokers and technologies in NinjaTrader (even simultaneously with our MultiBroker license).
        BertrandNinjaTrader Customer Service

        Comment


          #5
          I can't do that. Its nice to think everyone uses ninja script, but the reality is most use the language of their broker. And lets say that I am incorrect, to still get those customers that do use their broker language, my code needs to be "pure". So for example. If I keep my code pure, meaning using just C#, and can convert that right to Java, and bingo, I have all the indicators for 10+ other brokers that use Java as the platform language.

          Example:

          1. If I use all C#
          2. I can then convert right to Java
          3. Now I have exposure to every single Ninja trader customer, and every Interactive Brokers customers. And Interactive is just one company as an example
          4. We have already studied and determined how many customers of a particular platform, lets say IB, use the IB language versus using Ninja Script.
          5. And lets just say making the indicators available to IB customers via Java gives us WAY MORE CUSTOMERS versus if we did this in a ninja script
          6. Make sense?

          Comment


            #6
            Here is my concern. If I use all C#, and then ninja script to call my code, why can't I still
            "also connect to various brokers and technologies in NinjaTrader (even simultaneously with our MultiBroker license). ".

            Let me lay out the simple business plan:
            1. Create Ninja trader indicators to hit every single ninja trader customer
            2. Use C# so you can then convert to Java
            3. By converting to Java, you know have customer exposure to brokerages like Interactive Brokers and so forth

            But, are you saying I should
            1. Simply use Ninja Script because it way more straightf forward
            2. You then get every Ninja Trader customer
            3. Then write your indicators in Java when the time comes.

            So basically forget about converting from C# to Java. Just create them in Java when the time comes and save the time wasted going from C# to java.

            Comment


              #7
              wcranes, I could not comment on your business plan, I was raising the point working exclusively in NinjaScript would be easier to achieve your indicator suite plus you have access to many examples and directly usable code snippets and knowledge from the forums here.

              Technnically you can for sure create a DLL with all the calcs and just create the calling wrappers in NinjaScript for the plots and execution logic.
              BertrandNinjaTrader Customer Service

              Comment


                #8
                First, I have to say your support, and this forum is outstanding.

                Ok, I understand you cannot make a comment on my business plan.

                But, and forget about any business plan, you are saying as a programmer:
                Using ninja script, and just ninja script is going to be easier and more efficient oppossed to using C#. Correct? Given especially I do not even know C# nor .NET.

                Do not think in business, think as a programmer new to all of these.

                Comment


                  #9
                  Yes, with NinjaScript you already have the framework built for accessing price values, performing indicator calculations, etc. Without NinjaScript, this would have to be developed independently.
                  Ryan M.NinjaTrader Customer Service

                  Comment


                    #10
                    Last two questiond.
                    1. Can ninja script handle calculus and trig.
                    2. Is it much slower if I did use C# and called it via .DLL. Or is there almost no difference. THIS IS THE MOST IMPORTANT QUESTION

                    Comment


                      #11
                      Originally posted by wrcanes View Post
                      Last two questiond.
                      1. Can ninja script handle calculus and trig.
                      2. Is it much slower if I did use C# and called it via .DLL. Or is there almost no difference. THIS IS THE MOST IMPORTANT QUESTION
                      1. NinjaScript is a brand name and is C# thus you have full access to the Math class in .NET
                      2. If you coded your logic in a separate DLL and just called this DLL from a NinjaScript class, you would be going through an additional layer of code however, its not clear if this would have any performance impact and if it did, would be it be negligible.
                      RayNinjaTrader Customer Service

                      Comment


                        #12
                        Thanks so much to all of you......but i will be back.

                        Comment

                        Latest Posts

                        Collapse

                        Topics Statistics Last Post
                        Started by Perr0Grande, Today, 08:16 PM
                        0 responses
                        2 views
                        0 likes
                        Last Post Perr0Grande  
                        Started by elderan, Today, 08:03 PM
                        0 responses
                        5 views
                        0 likes
                        Last Post elderan
                        by elderan
                         
                        Started by algospoke, Today, 06:40 PM
                        0 responses
                        10 views
                        0 likes
                        Last Post algospoke  
                        Started by maybeimnotrader, Today, 05:46 PM
                        0 responses
                        11 views
                        0 likes
                        Last Post maybeimnotrader  
                        Started by quantismo, Today, 05:13 PM
                        0 responses
                        7 views
                        0 likes
                        Last Post quantismo  
                        Working...
                        X