Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Transfer Drawing Objects between Workspaces?

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

    Transfer Drawing Objects between Workspaces?

    Since the micro futures chart are very close to the mini futures chart, is there a way to have globally charted objects appear on both?

    If not, is there a way I can do a manual find and replace or renaming of one workspace to another? I have hundreds of chart objects on one I'd like to transfer to another and the .xml file is very confusing.

    Thanks!

    #2
    Hello hillborne,


    Thank you for posting on the NinjaTrader forums.


    Tools > Options > 'Global Drawing Objects Across Workspaces'.


    This will allow you to achieve what you are looking to do.


    Thank you in advance!

    Comment


      #3
      Hi Luis,

      Thanks for replying. It didn't seem to work as shown in the attached screenshots. I have both data series set to show global drawing objects.

      Please confirm this is possible on different instruments as I'm working with the e-mini and e-micro. From my research, I thought it wasn't possible and that's why I'm asking how to edit a workspace or if you know a way to transfer a few hundred chart objects.
      Click image for larger version

Name:	Micro.jpg
Views:	202
Size:	197.9 KB
ID:	1324695 Click image for larger version

Name:	Mini.jpg
Views:	190
Size:	164.0 KB
ID:	1324696

      Comment


        #4
        Hello hillborne,


        Thank you for the update.


        It is not expected for these objects to appear under different instruments as they would only show on the instrument you left the object on.


        Thank you.

        Comment


          #5
          Hi Luis,

          Yes, that was my understanding in the original question. So, I'm wondering if you have any insight into how I can transfer the drawing objects from one workspace to another. I'm not 100% sure the drawing objects are stored in the .xml workspace files but wherever they are, could I do a find and replace or edit them to attach them to another instrument? What file contains the drawing objects?

          Comment


            #6
            Originally posted by hillborne View Post
            What file contains the drawing objects?
            Workspace files store all the DrawingTools info for each Chart Tab.
            Here is a simplified sample xml structure that you'll be looking at.​

            Click image for larger version

Name:	ntwsxs.jpg
Views:	154
Size:	80.2 KB
ID:	1324799

            While I've never tried this, theoretically it should work.

            You would find the <DrawingTools> in each Chart "Tab" section.
            and copy them to your new workspace file Chart "Tab" section.

            With only going from mini's to micro's, but same contract,
            You might even get away w/only having to change NQ to MNQ.
            (InstrumentSerialize)

            Always BackUp xml files first! Better Safe than Sorry!


            Good Luck and Be Safe in this Crazy World!
            -=Edge=-
            NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

            Comment


              #7
              Originally posted by -=Edge=- View Post

              Workspace files store all the DrawingTools info for each Chart Tab.
              Hi Edge,

              Thank you very much for replying and pointing me in the right direction. However, I was totally confused when I opened up my workspace file and tried to find anything referencing DrawingTools. It turns out, there were none! None of my 6 tabs had any drawing tools in them even though I have several hundred horizontal lines on the chart.

              After some frustrating trial and error, I found out that if the drawingtool was set to: Attach To: ***(All charts), it doesn't appear in the Workspace file!

              So, where are they, then?

              I'm kinda back where I started because it seems like I would have to go through each of the drawing tools and set them to a specific Tab/Chart and then try to edit them onto the other instrument's tab.

              Unless someone knows where globally attached drawingtools are stored?

              Comment


                #8
                I'm trying to resurrect some code to export at least the 360 horizontal lines I have to a .txt file as a list but I think somethings have changed since I wrote it.

                Could someone help me export and import the Y-anchor point of the horizontal lines? Here's what I had for the export but the outputList is zero so I must not be identifying the horizontal lines correctly.

                Code:
                                outputList.Clear();
                                foreach (DrawingTool draw in DrawObjects.ToList())
                                {
                                    if(draw is DrawingTools.HorizontalLine)
                                    {
                                        Print("HorizontalLine Object: "
                                            + " GetType().Name: " + draw.GetType().Name
                                            + " draw.Tag: " + draw.Tag);
                
                                        HZ = draw as DrawingTools.HorizontalLine;
                                        outputList.Add(HZ.StartAnchor.Price);
                                    }
                                }
                
                                if (outputList.Count == 0)
                                {
                                    Print("*** No Horizontal Lines found on chart. Aborting... ***");
                                    return;
                                }
                
                                outputList = outputList.OrderByDescending(d => d).ToList();
                
                                try
                                {
                                    using (StreamWriter sw = new StreamWriter(path, false))
                                    {
                                        foreach (double item in outputList)
                                        {
                                            Print(item.ToString("F"));
                                            sw.WriteLine(item.ToString("F"));
                                        }
                                    }
                                }
                ​
                ​
                And here's the import process I had which I can't confirm if it still works yet:

                Code:
                            try
                            {
                                inputList.Clear();
                
                                using (StreamReader sr = new StreamReader(path))
                                {
                                    while (!sr.EndOfStream)
                                    {//Collect all Y values into list.
                                        string line = sr.ReadLine();
                                        if (!line.Contains("*"))
                                        {
                                            inputList.Add(double.Parse(line));
                                        }
                                        else break;
                                    }
                                }
                
                                //remove any duplicates and establish initial HSRs.
                                currentHSRs = new HashSet<double>(inputList);
                                inputList = currentHSRs.ToList();
                                inputList = inputList.OrderByDescending(d => d).ToList();
                
                                if (inputList.Count > 0)
                                {
                                    for (int i = 0; i < inputList.Count; i++)
                                    {
                                        HorizontalLine myLine = Draw.HorizontalLine(this, tagPrefix + inputList[i], inputList[i], true, "HLine1pxBlue");
                                        myLine.IsLocked = false;
                                    }
                                    importRan = true;
                                }
                                else
                                {
                                    Print("HSR File empty...");
                                }
                            }
                ​

                Comment


                  #9
                  Originally posted by hillborne View Post
                  Unless someone knows where globally attached drawingtools are stored?
                  My Apologies! I should have tested this before recommending it.
                  But, your right, once global, looks like they might be moved here:

                  C:\PathTo\Documents\NinjaTrader 8\templates\GlobalDrawingObject

                  Not sure if just duplicating the NQ 12-24.xml to MNQ 12-24.xml,
                  then modifying appropriate content like before would work or not.

                  Might be worth at least a quick test on one or two to and find out.
                  I would be interested to know how things worked after your test.


                  Be Safe in this Crazy World!
                  -=Edge=-
                  NinjaTrader Ecosystem Vendor - High Tech Trading Analysis

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by NullPointStrategies, Today, 05:17 AM
                  0 responses
                  52 views
                  0 likes
                  Last Post NullPointStrategies  
                  Started by argusthome, 03-08-2026, 10:06 AM
                  0 responses
                  130 views
                  0 likes
                  Last Post argusthome  
                  Started by NabilKhattabi, 03-06-2026, 11:18 AM
                  0 responses
                  70 views
                  0 likes
                  Last Post NabilKhattabi  
                  Started by Deep42, 03-06-2026, 12:28 AM
                  0 responses
                  44 views
                  0 likes
                  Last Post Deep42
                  by Deep42
                   
                  Started by TheRealMorford, 03-05-2026, 06:15 PM
                  0 responses
                  48 views
                  0 likes
                  Last Post TheRealMorford  
                  Working...
                  X