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

Drawing tools are not packaged with indicator

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

    Drawing tools are not packaged with indicator

    Hi, I am trying to export my indicator and my drawing tools as compiled assembly in single add-on (zip file) . But it is adding only the indicator dll, but not dll of drawing tools. Do I need to follow any additional steps ?

    #2
    Hello nandhumca,

    Thanks for your post.

    Can you clarify the steps you took to create the export assembly?

    Questions:
    1) Does the indicator specifically call the drawing tools you are adding?
    2) Can you show what the export zip file contains?


    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hi Paul, I am not referring or calling directly from indicator. I am using below reflection code to create the instance of drawing tool. My zip file contains only three file (Info, MyIndicator.cs, MyIndicator.dll)

      Core.Globals.AssemblyRegistry["NinjaTrader.Custom"].CreateInstance("MyDrawingTool") as DrawingTools.DrawingTool;

      Comment


        #4
        Hello nandhumca,

        Thanks for your reply.

        There are cases where Reflection is required for copying objects to new assemblies, which is used by Drawing Tools which use PriceLevels, but using reflection outside of cases like this would go beyond our scope of support.

        Could you elaborate on what you are trying to do when creating a new instance of the DrawingTool?

        Note that DrawingToolTile uses ChartControl.TryStartDrawing to invoke drawing tool pens.

        Getting past the reflection bits, could you also prepare a barebones set of scripts that we can import manually and take the same steps you are so we may better assist?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          I will share you the minimal code. Can you pls share me the sample code to create and call drawing tool from indicator?

          Comment


            #6
            Hello nandhumca,

            Thanks for your reply.

            Here is a quick example:

            else if (State == State.Realtime)
            {
            if (ChartControl != null)
            {
            ChartControl.Dispatcher.InvokeAsync(new Action(() => {
            ChartControl.TryStartDrawing("NinjaTrader.NinjaScr ipt.DrawingTools.Line");
            }));
            }
            }
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by cmtjoancolmenero, Yesterday, 03:58 PM
            11 responses
            39 views
            0 likes
            Last Post cmtjoancolmenero  
            Started by FrazMann, Today, 11:21 AM
            0 responses
            3 views
            0 likes
            Last Post FrazMann  
            Started by geddyisodin, Yesterday, 05:20 AM
            8 responses
            52 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by DayTradingDEMON, Today, 09:28 AM
            4 responses
            26 views
            0 likes
            Last Post DayTradingDEMON  
            Started by George21, Today, 10:07 AM
            1 response
            22 views
            0 likes
            Last Post NinjaTrader_ChristopherJ  
            Working...
            X