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

DrawingObject Index

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

    #61
    Hello James,
    You need as in below link:-
    These are duplicate chart markers to what comes with the platform except you can change the size of them. The existing chart markers will remain as well. This will allow you to create custom sized chart markers that you can create and save as default so that you can draw the markers as needed to […]

    Hope it helps!

    Comment


      #62
      Thank you, s.kinra.
      I think I looked at these before. I was looking for a way to have a User Input for the size. I think these are a template drawn on the chart only. I could be wrong that is for sure. LOL
      So, to add a User Input for the size is not available?
      Thanks again for everything.
      James

      Comment


        #63
        Hello James,
        I think you overlooked it, it indeed has size & you can change it as well, see the attached snapshot for reference (Draw Size highlighted in yellow).
        Hope it helps!

        Comment


          #64
          Good Morning s.kinra.
          I think I misunderstood. Can I use ninjascript to add a user input for the size and color inside the indicator or do they need to create a template from the chart?
          Thanks again for your help
          James

          Comment


            #65
            Hello James,
            You can use it similar to other drawing tools from within any indicator, of-course you can use public variables for size / color. Hope it helps!

            Comment


              #66
              Hello James,

              There are many questions here, and the topic is reaching several pages in length.

              We ask that new inquiries are created as new threads. This helps keep the forum organized so others browsing can find solutions and also helps our support staff in case a technician is out of the office and another technician needs to step in.

              Please see the description on the User App Share page for ChartMarlersPlus as it tells you how to use the modified Drawing Tools with NinjaScript. You can use intelliprompt in the NinjaScript Editor to get further hints on how to use the modified Drawing tools in code.

              Click image for larger version

Name:	chrome_2021-10-27_10-33-16.png
Views:	144
Size:	11.1 KB
ID:	1176469

              Intelliprompt - https://ninjatrader.com/support/help...elliprompt.htm

              As an example script:

              Code:
              namespace NinjaTrader.NinjaScript.Indicators
              {
                  public class TestChartMarkersPlus: Indicator
                  {
                      protected override void OnStateChange()
                      {
                          if (State == State.SetDefaults)
                          {
                              Name = "TestChartMarkersPlus";
                              IsOverlay = true;
                              Size = 100;
                          }
                      }
              
                      protected override void OnBarUpdate()
                      {
                          DrawPlus.Dotp(this, "tag", true, 0, High[0] + 10 * TickSize, Brushes.White, (float)Size, Brushes.Black);
                      }
              
                      #region Properties
                      [NinjaScriptProperty]
                      [Range(1, int.MaxValue)]
                      [Display(Name="Size", Order=1, GroupName="Parameters")]
                      public int Size
                      { get; set; }
                      #endregion
              
                  }
              }
              Result:

              Click image for larger version

Name:	NinjaTrader_2021-10-27_10-35-54.png
Views:	179
Size:	45.4 KB
ID:	1176468

              Please open a new thread if you have any new inquires.
              JimNinjaTrader Customer Service

              Comment


                #67
                Originally posted by s.kinra View Post
                Hello Tony,
                I use this similar to Current Bar which concatenate the Bar index & this does the price, so basically for every new High I have a new tag & when I call remove based on condition it retains the latest high. However, I don't use them very frequently but things are working for me so far. I don't know your exact issue & that's why I said something seems to be missing, I would suggest you to try removing the draw object in a new indicator with the logic & then you can include it in main code so it keeps things simple & easy for you to understand the behavior. This is how I get the things working for me & I am sure your things would be much more complex. I just try to keep it as simple as I can.
                Is it really wise to concatenate the bar index and the price? I am not a professional and I started trading not long ago. But from my little experience, I think this is a case to review.

                Comment


                  #68
                  Hello Dereck39,
                  There shouldn't be any issues while concatenating bar index & price but it all depends on your needs. The basic idea is to have a unique tag name for each drawing object. I personally prefer counter or bar index with a static string so I can easily identify the object type & still have unique names. Now what exactly you need & where you're getting stuck would need to look into to have a tag name best suited for your requirements. Hope it helps!

                  Comment


                    #69
                    Originally posted by NinjaTrader_Jim View Post
                    Hello James,

                    There are many questions here, and the topic is reaching several pages in length.

                    We ask that new inquiries are created as new threads. This helps keep the forum organized so others browsing can find solutions and also helps our support staff in case a technician is out of the office and another technician needs to step in.

                    Please see the description on the User App Share page for ChartMarlersPlus as it tells you how to use the modified Drawing Tools with NinjaScript. You can use intelliprompt in the NinjaScript Editor to get further hints on how to use the modified Drawing tools in code.

                    Click image for larger version

Name:	chrome_2021-10-27_10-33-16.png
Views:	144
Size:	11.1 KB
ID:	1176469

                    Intelliprompt - https://ninjatrader.com/support/help...elliprompt.htm

                    As an example script:

                    Code:
                    namespace NinjaTrader.NinjaScript.Indicators
                    {
                    public class TestChartMarkersPlus: Indicator
                    {
                    protected override void OnStateChange()
                    {
                    if (State == State.SetDefaults)
                    {
                    Name = "TestChartMarkersPlus";
                    IsOverlay = true;
                    Size = 100;
                    }
                    }
                    
                    protected override void OnBarUpdate()
                    {
                    DrawPlus.Dotp(this, "tag", true, 0, High[0] + 10 * TickSize, Brushes.White, (float)Size, Brushes.Black);
                    }
                    
                    #region Properties
                    [NinjaScriptProperty]
                    [Range(1, int.MaxValue)]
                    [Display(Name="Size", Order=1, GroupName="Parameters")]
                    public int Size
                    { get; set; }
                    #endregion
                    
                    }
                    }
                    Result:

                    Click image for larger version

Name:	NinjaTrader_2021-10-27_10-35-54.png
Views:	179
Size:	45.4 KB
ID:	1176468

                    Please open a new thread if you have any new inquires.
                    Hello Jim,
                    Happy Holiday.
                    I have been working again on this project and have a question.
                    I'm trying to set the size of the ChartMarkerPlus objects and that is good.
                    I need to have the objects shrink with the candle when zooming out.
                    Any help would be very much appreciated.
                    Thank you for your time.
                    James

                    Comment


                      #70
                      Hello laoshr

                      I would suggest looking at the default drawing objects and how they handled this in their Onrender, the most simple example would be in the chart markers script and the Dot objects OnRender. That shows how to incorporate the bar width to be used for rendering.
                      JesseNinjaTrader Customer Service

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by fx.practic, 10-15-2013, 12:53 AM
                      5 responses
                      5,406 views
                      0 likes
                      Last Post Bidder
                      by Bidder
                       
                      Started by Shai Samuel, 07-02-2022, 02:46 PM
                      4 responses
                      98 views
                      0 likes
                      Last Post Bidder
                      by Bidder
                       
                      Started by DJ888, Yesterday, 10:57 PM
                      0 responses
                      8 views
                      0 likes
                      Last Post DJ888
                      by DJ888
                       
                      Started by MacDad, 02-25-2024, 11:48 PM
                      7 responses
                      160 views
                      0 likes
                      Last Post loganjarosz123  
                      Started by Belfortbucks, Yesterday, 09:29 PM
                      0 responses
                      9 views
                      0 likes
                      Last Post Belfortbucks  
                      Working...
                      X