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

Save Chart Image - Automatically

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

    Save Chart Image - Automatically

    Hi, I was curious how I would go about accessing the "Save Chart image" method from within a strategy.

    I want to save the Image on each bar close, I am not sure if this method is accessible for use in strategies?

    I am playing with ML.Net using machine learning model I have been training and I want my strategy to save the chart for analysis by my model, which will then send back a trade or no trade signal to my strategy.

    if the trade was successful I will then categorise the image based on the result for retraining.

    for now just hoping I can call the save chart method already built into ninjatrader 8.

    #2
    I will probably just send the hotkeys if i cant call the method

    Comment


      #3
      Helllo,

      For NinjaScript you can apply the strategy directly to the chart and then use the code shown in the following samples to take images of the chart.

      https://ninjatrader.com/support/foru...865#post717865

      JesseNinjaTrader Customer Service

      Comment


        #4
        Originally posted by NinjaTrader_Jesse View Post
        Helllo,

        For NinjaScript you can apply the strategy directly to the chart and then use the code shown in the following samples to take images of the chart.

        https://ninjatrader.com/support/foru...865#post717865
        Thanks Jesse, my next question is more of a C# development question but hoping you might be able to help me by pointing to the correct learning resources.

        I want my strategy to call my external program and receive back the results for variable 'TradeSignal', I tried importing my model into Ninjatrader assembly and using it directly but it is .Net 6.0 so it isn't going to work that way (as far as i know).

        I am only just beginning to get my head around creating methods etc so creating a 3rd party program to be called by my strategy is a major leap for me..

        below is where I am at.... I will have to make my variables accessible from outside my ML program somehow.. and even from outside the assembly.

        I do have other options for my program in that I can make it either: A console app, .Net Api or a notebook.

        I am a bit unsure of how to inherit etc without having my program in the ninjatrader namespace or assembly (or whatever you call it )

        thanks in advance, I know this question has a university degree for an answer
        Last edited by BurnOutTrader; 08-16-2022, 11:44 PM.

        Comment


          #5
          Hello BurnOutTrader,

          This will start to escape the scope of support that we may offer, but we may be able to get you moving in the right direction.

          When working with external libraries with NinjaTrader, it is advised to build a .NET Framework 4.8 Console App in Visual Studio, use NuGet for getting DLL's, then to extract the DLL's used in the project. You could also consider a DLL that can be shared between NinjaTrader and your .NET Framework 4.8 Console App.

          Others have included netstandard 2.0 with NinjaTrader so they could interface libraries that require .NET Framework 4.8 + netstandard 2.0. Perhaps some community members could share their experiences there.

          Other than including the external libraries in NinjaTrader and baking the app in NinjaTrader, you would need to create your own interface to have two programs talk to each other.
          JimNinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Jim View Post
            Hello BurnOutTrader,
            Other than including the external libraries in NinjaTrader and baking the app in NinjaTrader, you would need to create your own interface to have two programs talk to each other.
            Hi Jim, thanks for the reply

            I experimented with creating an ML.NET model inside Ninjatrader.Custom; I was able to reference the Microsoft.ML DLLs after getting them through NUGET

            I eventually ran into problems with having code from a newer C# standard and i think this resulted in parts of the DLL not being found and I couldn't overcome the compile errors... its a shame because it seemed really close to working.

            ML.NET supports .NET 4.8 but apparently not the older C# standard. (or maybe it is just me)

            I only really need 3 variables to be sent back from my model, the strategy doesnt even have to tell the model to run this can all be done by using a simple trigger like whenever there is a new file created in a certain folder (my exported chart)

            I am thinking about doing as much as possible outside ninjatrader but only having my strategy fetch the latest copy of my 3 variables from some sort of persisting location, like a .CSV file...

            do you think this is a good idea, surely it will be easier than making my own DLLs to work in two different language standards?


            essentially i will just have the models run perpetually on their own, and have them update a .csv and then have my NT8 strategy fetch the latest row added to my .csv file for its variables.
            Last edited by BurnOutTrader; 08-17-2022, 03:05 AM.

            Comment


              #7
              Hello BurnOutTrader,

              This would really be subjective to your need and amount of effort you would want to spend. Our perspective here would also be limited.

              A file interface may be easiest, but somethings to consider would involve multiple programs accessing the file at the same time, speed, etc.

              Good luck with your project, and please follow up with the community on your accomplishments!
              JimNinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_Jim View Post
                Hello BurnOutTrader,

                This would really be subjective to your need and amount of effort you would want to spend.
                Ok thanks, with the information provided and after a bunch of playing around and learning about NuGet, I have decided to go the way of building my own class library in standard 2.0 and using SQL to serialize data long term so that I can access or review it in excel formats later if I want; this also seem the easiest as I can get running pretty quickly but also version and build on it long term.

                I am also doing a course on Udemy for Azure ML because I was side tracked into that service and opened up an even larger can of worms; at least I should come out of this with a workable knowledge on software development.

                Thanks for the help.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Zinger357, Today, 11:50 AM
                3 responses
                19 views
                0 likes
                Last Post Zinger357  
                Started by dylansmoo, Today, 07:04 PM
                0 responses
                3 views
                0 likes
                Last Post dylansmoo  
                Started by WalterSkinner, 02-07-2022, 09:22 AM
                6 responses
                78 views
                0 likes
                Last Post Lance El Camino  
                Started by shorty, Today, 06:20 PM
                1 response
                19 views
                0 likes
                Last Post Tasker-182  
                Started by dweems, Yesterday, 02:11 PM
                1 response
                46 views
                0 likes
                Last Post NinjaTrader_Angelica  
                Working...
                X