Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Historical data

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

    Historical data

    Hi there, I am new to Ninja. I have just worked out how to upload 1min historical data in USDCHF which uploaded successfully, using the suggested format. I am now trying to link the master instrument code to this data so that I can plot my chart and then apply my strategy. Can anyone please tell me how to link my data to the master instrument please...

    Many thanks

    #2
    Hello,

    Thanks for your forum post.

    Can you please rephrase what it is your trying to do and where your at so that I may further assist.

    What data feed provider are you connected too or are you importing data in manually.

    If you inport data this will show up under the instrument name you imported.

    Can you pull the data up in a chart?

    Finally, What do you refer to with Master Instrument code? Are you trying to run an automated strategy?

    I look forward to assisting you further.

    Comment


      #3
      Following on from earlier i realise that i wasn't very clear...ok

      What I am trying to do is to format the historic data that I have which looks like this:

      USDCHF,20010102,230100,1.5989,1.5990,1.5988,1.5988 ,4
      USDCHF,20010102,230200,1.5988,1.5988,1.5988,1.5988 ,4
      USDCHF,20010102,230300,1.5990,1.5991,1.5990,1.5991 ,4
      USDCHF,20010102,230400,1.5991,1.5991,1.5991,1.5991 ,4
      USDCHF,20010102,230500,1.5991,1.5991,1.5990,1.5990 ,4

      And I am trying to put it into a format that Ninja can read. I have managed to put some of it into Notepad using the script below, the only thing is I can't manage to replace the commas above with ";". If you can shed some light so I can format my data so I can then start building my strategies i'd be hugely greatful...or otherwise tell me I am completely wrong...:-) Many thanks


      vPathToFileIn = "C:\EURUSD2.txt"
      vPathToFileOt = "C:\$EURUSD2.txt"
      'rename the output file to the standard Ninja Trader file name, then Import
      Dim oFSO, oFileIn, oFileOt, vLineIn, vLineCnt, vLineOt
      'get link to file system support
      Set oFSO = CreateObject("Scripting.FileSystemObject")
      'open both files (in and out)
      Err = 0
      Set oFileIn = oFSO.OpenTextFile(vPathToFileIn, 1) '1=read
      Set oFileOt = oFSO.CreateTextFile(vPathToFileOt, True) 'true=overwrite
      If Err <> 0 Then
      Wscript.Echo "Error on file open: " & Err.Number & ", " & Err.Description
      Wscript.Echo "stopping"
      Wscript.Quit
      End If
      '
      'do the reformat
      'input format
      'EURUSD,20010102,230100,0.9507,0.9507,0.9507,0.950 7,4'
      'output format
      '20090819 230600;1.4225;1.4225;1.4223;1.4224;171100000
      vLineCnt = 0
      Do Until oFileIn.AtEndOfStream
      vLineIn = ""
      vLineIn = oFileIn.ReadLine
      vLineCnt = vLineCnt + 1
      'if vLineCnt > 10 Then Exit Do
      vLineOt = ""
      vLineOt = Mid(vLineIn,8,8) & " " 'date
      vLineOt = vLineOt (vLineIn,17,22) & "." 'time
      vLineOt = vLineOt & Mid(vLineIn,18,99) 'O,H,L,C,V

      'Wscript.Echo "about to write: " & vLineOt
      Err = 0
      oFileOt.WriteLine(vLineOt)
      If Err <> 0 Then
      Wscript.Echo "Error on file write: " & Err.Number & ", " & Err.Description
      Wscript.Echo "stopping"
      Wscript.Quit
      End If
      Loop

      '
      'close the files
      oFileIn.Close
      oFileOt.Close
      '
      'tell user count and quit
      Wscript.Echo "transferred " & vLineCnt & " lines. stopping now."
      Wscript.Quit
      '
      ' **************************** END OF SCRIPT ******************************************

      Comment


        #4
        Hello,

        Thanks for that clarification.

        So your unable to import in the historical data since its in the wrong format. In this case you would need to fix the market errors so that it looks like this:




        Unfortunately how you specifically do this is outside the level of support I would be able to provide but it looks like your on the right track. You would need to use some sort of batch editor to change the data into a format NinjaTrader can read.

        Let me know if I can be of further assistance.

        Comment


          #5
          Sorry to be a bother and I know this probably isn't the right section to ask this
          but I have no where else to ask this...
          For the life of me, I cannot figure out how to create a new post.
          I would like to open a new discussion for an issue I am having.
          I can only find how to Reply to existing posts.
          Please help. Thank you.

          Comment


            #6
            Hello,

            When you are in a section that you can post just like you can see the Post Reply button here you will see a new thread button in the same spot.

            If you are still having trouble email me at support at ninjatrader dot com and let me know your question and I can help from their also.

            I look forward to assisting you further.

            Comment


              #7
              Hi again, Sorry but I still can't seem to locate a section that has "new thread" button.
              I did read somewhere that I may have to have permission to post a new thread.
              Could it be that I need permission? which may be why the button is not displaying?
              You referred to "section" (see below) Maybe you could send me a link to a section that displays the "New Thread" button? Then I can take from there. I'm sure this should be pretty straight forward, I am very computer savy, this is really embarrassing. Thanks again for your assistance.

              When you are in a section that you can post just like you can see the Post Reply button here you will see a new thread button in the same spot.

              Comment


                #8
                Hello,

                Checking into with my forum admin. Quick question in meantime, Are you sure that you validated your account by the email that was sent you your email address to allow you to make new threads by verifying your email address as I see this is a new forum account.

                Comment


                  #9
                  I double checked my emails, found the activation email, followed the link an it says "Your account has already been activated..." I even re-entered my activation ID. Again, I can see "Post Reply", "Quote", "Reply" but still no "New Thread". Thanks again.

                  Comment


                    #10
                    I got it working... Thanks again for your assistance. Have a great day.

                    Comment


                      #11
                      Hello,

                      Excellent, glad you where able to get it working.

                      Let me know if I can be of further assistance.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by f.saeidi, Today, 12:14 PM
                      4 responses
                      11 views
                      0 likes
                      Last Post f.saeidi  
                      Started by Russ Moreland, Today, 12:54 PM
                      1 response
                      6 views
                      0 likes
                      Last Post NinjaTrader_Erick  
                      Started by philmg, Today, 12:55 PM
                      1 response
                      7 views
                      0 likes
                      Last Post NinjaTrader_ChristopherJ  
                      Started by TradeForge, 04-19-2024, 02:09 AM
                      2 responses
                      32 views
                      0 likes
                      Last Post TradeForge  
                      Started by aprilfool, 12-03-2022, 03:01 PM
                      3 responses
                      329 views
                      0 likes
                      Last Post NinjaTrader_Adrian  
                      Working...
                      X