Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

history to file

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

    history to file

    Hello my dear friends.
    I want to save historical data quotes for txt or csv file in a format OHCL.
    I have write such script for MT4 a few years ago, it get history form every time frame and write into different text files (last 2000 bars), so I can analyze it with external tools.
    Who have wrote such script? I can give you my script for MT4. I just need to know a few rows of code to accessing to historical data and writing it to a file.

    #2
    Here you go
    Attached Files

    Comment


      #3
      Originally posted by Baruch View Post
      Here you go
      Thanks for the example of sources, but they did not work.
      This code produce two rows into a file, a caption and zero data for 1800 year.
      I have modify it a little. It give last 100 bars, but they are wut zero data too. How change it, how to get normal data?
      Attached Files

      Comment


        #4
        Of course it works. I would not give something that doesn't.
        How did you run it?

        Comment


          #5
          Just go into strategy analyzer and run a backtest.

          Comment


            #6
            Ok, I try it. But why it does not at work at chart? I thought that it can work correct from chart.
            When I create such solution for MT4 I just push script into a chart.

            Comment


              #7
              Originally posted by Baruch View Post
              Just go into strategy analyzer and run a backrest.
              It's work perfect. Thanks a lot. I have all history I need in CSV files for analysis.
              But how I can send real -time data to files or to dll.
              Could you geve me samples of code for pushing OHCl data of two last candles to text file, and how I can call dll from NT7 and import function from it, because a have a huge algorithm's into dll's written on Delphi.

              Comment


                #8
                daglas, these samples can help writing information to a file using NinjaScript:

                Ryan M.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_RyanM View Post
                  daglas, these samples can help writing information to a file using NinjaScript:
                  thanks for links. May be you can give me some links for working with external dll, I want to know syntax of calling procedures and functions from it, and just want to see a few samples.

                  Comment


                    #10
                    There is not a sample available for working with dlls. If you import the dll successfully, then the methods, properties, etc are available to access the same as other indicators. You can export a custom indicator as dll and then import it back in to see how this works. In some cases you will have to delete existing source prior to import.

                    Ryan M.NinjaTrader Customer Service

                    Comment


                      #11
                      Originally posted by NinjaTrader_RyanM View Post
                      There is not a sample available for working with dlls.
                      How can I work with external dll? Can NT7 works with external dll not .NET based, writen on other languages like Delphi, or work with a standard windows dll like wininet.dll or gdi32.dll?

                      Comment


                        #12
                        You can try with your external dll, by adding a reference to it through the Right Click > References screen in the NinjaScript code editor. Unfortunately our support for running external dlls is limited, so you will have to try on your end to see if your particular dll is compatible.
                        Ryan M.NinjaTrader Customer Service

                        Comment


                          #13
                          Originally posted by NinjaTrader_RyanM View Post
                          You can try with your external dll, by adding a reference to it through the Right Click > References screen in the NinjaScript code editor. Unfortunately our support for running external dlls is limited, so you will have to try on your end to see if your particular dll is compatible.
                          Where can I read about working with external dll? For example with standard Windows dll like wininet, gdi32.dll? How can I cal their finctions from ninjaTrader scripts?

                          Comment


                            #14
                            daglas, as RyanM said, we only provide limited support for external .dlls, such as how to add a reference to those .dlls in your scripts, which RyanM already did. Once you have the reference added, you are on your own, as every .dll is different and we would not know how to use each and every .dll.

                            I would imagine you could utilize Google to find some examples of how to use wininet and gdi32.dll in your code.
                            AustinNinjaTrader Customer Service

                            Comment


                              #15
                              Originally posted by NinjaTrader_Austin View Post

                              I would imagine you could utilize Google to find some examples of how to use wininet and gdi32.dll in your code.
                              Thanks. I know how to work with wininet and gdi32. But when I add reference to my indicator I receive error message - can't open meta data fille c:\***\wininet.dll. I also try different types of dll from Microsoft and my own dll's write in Delphi 6.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Tim-c, Today, 10:58 AM
                              0 responses
                              1 view
                              0 likes
                              Last Post Tim-c
                              by Tim-c
                               
                              Started by traderqz, Yesterday, 09:06 AM
                              3 responses
                              21 views
                              0 likes
                              Last Post NinjaTrader_ThomasC  
                              Started by f.saeidi, Today, 10:19 AM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_BrandonH  
                              Started by kujista, Today, 06:23 AM
                              5 responses
                              18 views
                              0 likes
                              Last Post kujista
                              by kujista
                               
                              Started by traderqz, Today, 12:06 AM
                              3 responses
                              6 views
                              0 likes
                              Last Post NinjaTrader_Gaby  
                              Working...
                              X