Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ChatGPT integration into Ninjascript Code Editor?

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

    ChatGPT integration into Ninjascript Code Editor?

    I'm not a pro coder, and I only learned C# out of necessity due to Ninjatrader.

    I have actually gained some new, recent knowledge about C# from ChatGPT, and it's been very forthcoming in providing sample code that works. Especially if it involves something off the beaten NT path and yet simple for many but perhaps not to me (a non-coder), ChatGPT is a wonderful tool.

    ChatGPT is not an expert at Ninjascript, however, though it is familiar with it. So, it gets me most of the way there but not all the way.

    You might consider integrating a customized ChatGPT-like mentor into your editor that would provide good quality advice on solving common problems. This could be particularly useful for de-mystifying strategy development.

    It's pretty clear the NT platform was designed to accomplish some fairly sophisticated things, and some AI assistant might broaden your audience and help your business grow.
    Last edited by catinabag; 04-13-2023, 06:12 AM.

    #2
    Hello, thanks for writing in. I will submit a feature request for this.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      catinabag Speaking as someone who did his masters in data analytics and spent a lot of time with large language models like this one, I believe that while it's intriguing, you are not in reality further along working with ChatGPT output than you are just using Google or looking at examples on the forum or elsewhere online.

      What tools like this will do is give you bits and pieces of other code they've found online, but without any actual "thought" so it will tend to be combinations of NT7 code and NT8 code, be missing major, important things, contain lots of things that aren't material to the question, and generally be unlikely to compile or work. It might give you some ideas, but the ideas won't be as high quality as what you would get with Google or searching the forum, and you'll be sent on a lot of wild goose chases trying to figure out why it put some reference in there that will turn out to be completely made up. You'll have lots of little things you would have to fix in its output before you could even compile much less achieve your objectives, and by the time you figure out what all of those are, you could easily have written the thing in question.

      I have a prediction to make - if this is done, the forum will be flooded by posts saying "I'm 99% of the way there - can you help me fix this code?" and it will be all complete garbage output by a large language model that doesn't even make any sense and will waste a huge amount of everyone's time.

      I do have an idea, though, to suggest, that might work.

      NinjaTrader already has a strategy builder that outputs code that does work (or at least compiles and makes sense given what you asked it to do) - what about using ChatGPT or another large language model to interpret your English language request and set up strategy builder correctly for the query you asked for? That has the advantage that it will compile, and leaves you with something you can actually work with immediately and continue to improve.
      Last edited by QuantKey_Bruce; 04-13-2023, 10:04 AM.
      Bruce DeVault
      QuantKey Trading Vendor Services
      NinjaTrader Ecosystem Vendor - QuantKey

      Comment


        #4
        It is very clear that you are very experienced and knowledgeable. However, the easier they make it for less knowledgeable people to work with more complex things like custom buttons, strategies and whatever else (eg, I like to stream output for later analysis), the better the platform will be and the broader their customer pool. I personally am not very keen to pay a random vendor $29 for a custom button when I should be able to do it myself, and I don't seek to hassle this Forum every time I want to make a change to my screen. Speaking from my own experience, it seems that some type of AI assistant could benefit many non-coders.

        Comment


          #5
          Hi, we are tracking this feature request ID: SFT-5858.
          Chris L.NinjaTrader Customer Service

          Comment


            #6
            catinabag You are right in much of what you say. So is QuantKey_Bruce.

            Perhaps the most important word missing is "good". "Good AI" is the key. Currently, the arguably best GPT AI engine available is GPT-4.

            As a professional Software Engineer with more than four decades of programming experience, I have experimented with ChatGPT ("GPT-3.5") and GPT-4 out of interest. As QuantKey_Bruce has rightly observed, and you yourself have found, the results are, at best, mixed.

            One example I tried, for an area of general C# programming (not NinjaTrader specific) I had not spent much time on, took nearly a dozen differently-framed requests with associated different outputs to obtain code that worked after aggregating various parts of each output and further editing. It was useful code of several rather complex lines, and it did what I wanted. I later found code on StackOverflow to do exactly the same thing in a single, elegantly simple line of code, that only an intuitive human being could have created.

            It's not "wrong" to use the current crop of AI to try to find useful solutions to knotty problems. But, for the foreseeable future at least, it should be nothing more than "input for consideration" along with other sources of knowledge, and must be subject to close scrutiny and a healthy degree of scepticism and rigourous testing before being used for anything serious.

            You will prosper more in your trading and your learning to program by doing just that -- learning to program. NinjaTrader_ChelseaB and others have very helpfully on many occasions provided links to good online sources of programming tutorship and references -- a quick search of the Forum will find those links. You will benefit greatly (and more quickly) by making that your priority. And it will make your review of any AI-generated code far more effective.

            Would I prioritise inclusion of such an AI "feature" over the huge array of currently pending "features"/bugs that need attention? Not for a moment.

            Thanks.​
            Multi-Dimensional Managed Trading
            jeronymite
            NinjaTrader Ecosystem Vendor - Mizpah Software

            Comment


              #7
              I am somewhat convinced that because ChatGPT is currently a shiny thing in the news, the pressure to incorporate it will be intense, yet it won't help produce a profitable trading strategy. To do so requires knowledge of a whole bunch of different domains and being stuck, as jeronymite found in his experiments described above, having to try to splice together bits and pieces and then massage them around until they finally do something, you would have been a lot better to have spent that time Googling or searching the forum or reading the help to see how to do the things you're trying to do because then, you would actually know how to do it, whereas ChatGPT provides the illusion of knowledge - it's an illusion because half of the things it says are made up or are from some other version of NinjaTrader or from some other platform, yet they're all blended together and stated with complete confidence despite that the answer won't compile and does not, to a human developer, even usually make sense. My main concern is it will waste a lot of time and resources - as pointed out above - there are a lot of extremely pressing things right now and this is not really one of them.

              This is why I suggest, as I did above, that if you use a LLM to provide an English language capability, it should drive the Strategy Builder, rather than trying to output compilable code - at least then, the result will run and will compile.
              Last edited by QuantKey_Bruce; 04-14-2023, 04:33 PM.
              Bruce DeVault
              QuantKey Trading Vendor Services
              NinjaTrader Ecosystem Vendor - QuantKey

              Comment


                #8
                As an experiment, I used Chat GPT to generate "code" (it's actually code snippets) and then I showed it to an experienced C# programmer and he said while it was "functional" that it was a mess....

                The "I created a trading bot and made MiLLiOns" on YouTube don't help either... Best bet is to follow the advice of the sages in this forum... and supplement what they offer with training... In this case, Chat GPT and/or LLM's aren't the solution... Learn the skill... Udemy has some really low-priced opportunities to supplement your KNOWLEDGE and set you up for future success...

                Comment


                  #9
                  Originally posted by brenthilburn View Post
                  As an experiment, I used Chat GPT to generate "code" (it's actually code snippets) and then I showed it to an experienced C# programmer and he said while it was "functional" that it was a mess....

                  The "I created a trading bot and made MiLLiOns" on YouTube don't help either... Best bet is to follow the advice of the sages in this forum... and supplement what they offer with training... In this case, Chat GPT and/or LLM's aren't the solution... Learn the skill... Udemy has some really low-priced opportunities to supplement your KNOWLEDGE and set you up for future success...
                  I did the same early on after ChatGPT was released to see what it could do - giving it a whole bunch of NinjaScript and C#-related prompts phrased different ways to see what was possible. It's interesting as entertainment but it would actually slow me (or I think, almost anyone) down in terms of actual productivity because it sends you on a large number of side quests to try to figure out why this or that doesn't work or doesn't compile or to figure out what's missing - often, it will reference functions that don't even exist but just "sound believable" or it will pull in code that might have worked in NinjaTrader 7 but won't work in NinjaTrader 8 or it will leave out major things - like how to define the input parameters - or it will add a bunch of irrelevant things, like adding a bunch of data series and then ignoring them but they cause the code to all break later. It's sort of interesting, but not productive. It's like a NinjaScript babble generator. So, the stated objective of the poster earlier who said he was a programming beginner and wanted to use ChatGPT to save time would not be achieved here because it would throw up a huge number of little problems that he would end up posting to the forum about or spending days and days trying to fix which would just frustrate everyone including himself because the generated code is gibberish and it would have been a LOT faster to just read the documentation and look at examples to learn to do what you're trying to do.

                  The worst thing about it, in its current incarnation, is it states matter of factly that something is the solution and "here you are" but what it just said is flatly wrong and really, not even close - it just contains enough of the right words and in the right format that to a non-developer it looks believable - yet, beneath the surface, it is all just a waste of time compared to actually coding up what you wanted.

                  I think maybe in another version or five it might approach usefulness for this task but it is certainly not there yet. Right now it's entertainment, or a research tool... One day, perhaps... I am a believer that this approach will be useful in the future as a productivity tool some day but it is not there yet.
                  Last edited by QuantKey_Bruce; 04-15-2023, 05:44 AM.
                  Bruce DeVault
                  QuantKey Trading Vendor Services
                  NinjaTrader Ecosystem Vendor - QuantKey

                  Comment


                    #10
                    Well, I think you all prove my point.

                    4 decades of experience coding: that is not the average profile for a prospective NT consumer! Plenty of MDs, PhDs, JDs, MBAs, etc: those are plenty smart folks who can click a mouse to trade but don't want to re-invent themselves as C# experts.

                    For example:

                    The Half Trend indicator on TradingView is free. If you want it on NT 8, you either code it or pay some vendor $249. I coded it, but most folks would not want to bother at all, so they would stick with TradingView instead. Such people would certainly benefit from an AI Assistant that converts Pine Script (or MQL4 or whatever else) to Ninjascript. Otherwise, it's hard to see the value proposition of using NT instead of TradingView.

                    ChatGPT is not designed to code in Ninjascript; yet, I used it this morning, and it shed a lot of light on some subjects for me. If it was customized by NT to support NT 8 users, it would greatly expand the number of people who would consider using NT 8, and it would benefit existing NT users, also. Finally, a bigger, more successful NT would certainly be beneficial to everybody.

                    Comment


                      #11
                      Shout out to PJSmith whose blog inspired me to want more out of the platform.

                      Comment


                        #12
                        Article in the Wall Street Journal forbodes a change in how people interact with heretofore "black box" SaaS business models.



                        It shan't be long 'til a smart NT vendor figures out he or she will make more money creating a "Rosetta Stone" which translates existing TradingView code into NT 8 and vice versa, as well as into or from other platforms languages, and beats NT to the punch.

                        Comment


                          #13
                          catinabag and MikailuIbrahim,

                          Thank you for your feedback.

                          I've added two votes for you both to SFT-5858.
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #14
                            Highly doubt NinjaTrader will integrate ChatGPT because then they'd be sort of accepting responsibility for debugging the code it generates. Maybe if NinjaTrader charged a spread on top for it, but otherwise your best bet is just copying and pasting into chatgpt.

                            But also, chatgpt isn't too great with NinjaTrader specific coding because it doesn't have enough knowledge of Ninja libraries. It can help with c# standard things like loops, etc, but it hallucinates the Ninja classes like crazy

                            Comment


                              #15
                              Yes, right now, it actually slows one down because you don't know which parts of the API it made up, and that's a huge setback if you don't know much about NT. If you're a great NT coder, you might could use it to just sort of get a quick feedback on ideas but if you're a poor NT coder, you won't know which parts it made up, and being lied to is worse than having no information because you're not in a good position to evaluate which parts are wrong.

                              If NinjaTrader were to add this as a feature, they would then get thousands of reports from users who used that feature but it didn't generate working code, and that would be worse than their current situation. It would be necessary to screen the output of the LLM in various ways - just seeing if it compiles is not enough - and by the time they did all that they would be way behind on other features they could be adding that generate revenue.
                              Bruce DeVault
                              QuantKey Trading Vendor Services
                              NinjaTrader Ecosystem Vendor - QuantKey

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by fx.practic, 10-15-2013, 12:53 AM
                              5 responses
                              5,404 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by Shai Samuel, 07-02-2022, 02:46 PM
                              4 responses
                              95 views
                              0 likes
                              Last Post Bidder
                              by Bidder
                               
                              Started by DJ888, Yesterday, 10:57 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post DJ888
                              by DJ888
                               
                              Started by MacDad, 02-25-2024, 11:48 PM
                              7 responses
                              159 views
                              0 likes
                              Last Post loganjarosz123  
                              Started by Belfortbucks, Yesterday, 09:29 PM
                              0 responses
                              8 views
                              0 likes
                              Last Post Belfortbucks  
                              Working...
                              X