• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Selecting colors dots, triangles and arrows in indicators

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

    Selecting colors dots, triangles and arrows in indicators

    Hello

    I am writing my first indicator, a very simple one. It is already running ok, but I would like to improve it and, when I put it in my chart, to be able to select the color of the objects that draws in, not just the one selected in the code.

    Thanks

    #2
    Hello Impeesa, thanks for your question.

    All of our drawing methods have an override that takes a templateName property. So you can draw the object you want, set up the drawing object manually on a chart then save it as a template. Use that template name in the method override and it will use all of the settings you have in the Template. e.g. If I set up a template named "MyTemplate":

    Code:
    Draw.Dot(NinjaScriptBase owner, string tag, bool isAutoScale, DateTime time, double y, bool isGlobal, string templateName)
    Draw.Dot(this, "MyDot", false, MyTime, MyYValue, false, "MyTemplate");
    Please let me know if I can assist any further.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Hello, Chris

      I have not programmation skills and all I can do is analyse indicator examples and copy and paste parts of the code and run them, again and again...

      Can you remember a free stuff indicator in Ninjatrader Ecosystem that I can use as example?

      Thanks

      Comment


        #4
        Hello Impeesa,

        You can use the Strategy Builder to have it generate syntax for drawing objects.

        Strategy Builder 301 (publicly available recording) - https://www.youtube.com/watch?v=HCyt90GAs9k

        Drawing On a Chart - https://ninjatrader.com/support/help...ToDrawOnAChart

        You can then copy the generated drawing code in an indicator that has Brush inputs added from a New Indicator Wizard. Then replace the Brush in the Draw method (Brushes.Green for example) with the Brush property you created with the wizard.

        New Indicator Wizard - https://ninjatrader.com/support/help...?ns_wizard.htm

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          Hello Jim

          In New Indicator Wizard there are only Plot style, nor triangles, diamond and arrow objects. What I want is to be able to select the colors of this objects whan I open the indicator in a chart, as I can do in others. Click image for larger version

Name:	02_07_2020_1351.jpg
Views:	14
Size:	38.3 KB
ID:	1107690Click image for larger version

Name:	02_07_2020_1352.jpg
Views:	15
Size:	36.0 KB
ID:	1107691

          Comment


            #6
            Hello Impeesa,

            The New Indicator Wizard allows for creating Brush inputs. I have attached some screenshots.

            You would then use the Brush inputs to control the Brush used with the Draw method.

            I.E.:

            Draw.Dot(this, "tag1", true, 0, Low[0] - TickSize, Brushes.Red);

            would by replaced with your Brush input. In the case of the attached screenshots, this would be "MyBrush"

            You can use the Strategy Builder to generate syntax for using Drawing methods and you can implement those in an indicator after you observe how the Strategy Builder generates the code.

            We look forward to assisting.
            Attached Files
            JimNinjaTrader Customer Service

            Comment


              #7
              Great! Thanks a lot!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by digibob, 07-08-2020, 03:45 AM
              5 responses
              35 views
              0 likes
              Last Post johnnymustard  
              Started by kanavancbduk, Today, 01:21 AM
              0 responses
              7 views
              0 likes
              Last Post kanavancbduk  
              Started by yalmandraku, Today, 01:21 AM
              0 responses
              5 views
              0 likes
              Last Post yalmandraku  
              Started by kanavancbduk, Today, 01:20 AM
              0 responses
              4 views
              0 likes
              Last Post kanavancbduk  
              Started by josenfit, Today, 01:03 AM
              0 responses
              3 views
              0 likes
              Last Post josenfit  
              Working...
              X