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

Grid Data Extraction

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

    Grid Data Extraction

    I wonder if there is a way or script to extract Grid Data periodically (Every specific time) Instead of right click on NinjaTrader 'Control Center - Strategies' Window then hit Export to export whether xlsx or csv file , I want to automate this

    #2
    Hello Badr123,

    Thank you for your post.

    What you have described may or may not be possible to automate, though there is no supported/documented method for doing so via NinjaScript. This thread will remain open for members of the forum community to chime in with their thoughts or ideas on how this might be possible.

    Otherwise, you could consider adding logic into your strategies directly that writes the desired data to a text file via StreamWriter. That text file could then potentially be converted to a xlsx or csv spreadsheet file. For an example of using StreamWriter to write to a text file:


    Please let us know if we may be of further assistance.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Hello Emily

      Can you please provide me with the code or example how to
      write the desired data to a text file via StreamWriter ?​

      Comment


        #4
        Originally posted by Badr123 View Post
        Hello Emily

        Can you please provide me with the code or example how to
        write the desired data to a text file via StreamWriter ?​
        The link I provided contains a download for a reference sample that demonstrates how to write to a text file with StreamWriter. It is up to you to decide which data you would like to write to that file; in terms of the Strategies tab of the Control Center, you can get items such as the average price, unrealized PnL, etc. via NinjaScript methods and properties available such as the following:There are other metrics you could access from a TradeCollection:Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          Create a custom NinjaScript strategy to handle the data extraction. NinjaScript allows you to write custom C# scripts for NinjaTrader. By leveraging NinjaScript, you essentially create a data enrichment tool that automates the extraction process. This tool can be tailored to your specific requirements, allowing you to gather the necessary data at scheduled intervals without manual intervention.
          Last edited by Morkab; 01-19-2024, 02:25 AM.

          Comment


            #6
            Originally posted by Morkab View Post
            Create a custom NinjaScript strategy to handle the data extraction. NinjaScript allows you to write custom C# scripts for NinjaTrader.
            Can you give me at least example for script to print all my Instrument in the "Control Center - Strategies" window please ?

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DJ888, Today, 10:57 PM
            0 responses
            6 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by MacDad, 02-25-2024, 11:48 PM
            7 responses
            158 views
            0 likes
            Last Post loganjarosz123  
            Started by Belfortbucks, Today, 09:29 PM
            0 responses
            7 views
            0 likes
            Last Post Belfortbucks  
            Started by zstheorist, Today, 07:52 PM
            0 responses
            7 views
            0 likes
            Last Post zstheorist  
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            151 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Working...
            X