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

Editing Fib Retracement Properties

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

    Editing Fib Retracement Properties

    Can anyone suggest the closest indicator template (I could not find anything similar in the indicators library) to adapt for automatically changing the properties of Fib retracements and adding labels and adding calculations next to the lines - I was hoping to use my limited programming skills to do the rest?

    #2
    Ok I now see that Fibo properties cannot be edited - is it still possible to extract values of different retracements and add labels next to them?

    Comment


      #3
      Hello Tanguero,

      Thank you for your post.

      You would not be able to access the values from the Fibonacci draw objects.

      You would need to create your draw object so you can grab those values and add the labels.

      Let me know if I can be of further assistance.
      Cal H.NinjaTrader Customer Service

      Comment


        #4
        Thanks - is it possible to retrieve values of any other objects, be it a line, a square or anything else - my goal is to manually draw such object first to show the indicator which two bars I am interested in, then the indicator would automatically calculate the stop loss and take profit value based on the price difference between the bars and print these numbers?

        Comment


          #5
          Tanguero,

          Thank you for the information.

          In this case, you can look into the IDrawObjects, also along with IRectangle, ILine and so forth.
          This will get the exposed values that you want.
          http://www.ninjatrader.com/support/helpGuides/nt7/index.html?idrawobject.htm
          Cal H.NinjaTrader Customer Service

          Comment


            #6
            Great. Could you suggest where to look up the functions for extracting values of IDrawObjects - can't find these anywhere on the help pages.

            Comment


              #7
              Hello Tanguero,

              Are you looking for a listing of the available methods that you can access for each type of draw object?

              These are all available if you expand the "Drawing" section that is located in the help guide under:
              NinjaScript -> Language Reference -> Drawing

              Here is a link to that section


              Please let me know if I may be of additional assistance.
              JesseNinjaTrader Customer Service

              Comment


                #8
                Actually, the reverse: say if I draw a rectangle manually, what function will get back the startY and endY values so that these can be used for further calculations?

                Comment


                  #9
                  Hello Tanguero,

                  Thanks for clarifying that for me.

                  I would recommend taking a look at the following link. It is for an indicator called Alert for manually drawn lines. This has essentially what you are asking for in its code.

                  One note, manually drawn lines can be accessed from NinjaScript but not edited.

                  Heres the link: http://www.ninjatrader.com/support/f...d=4&linkid=472

                  Here is an example of getting the Y value from a Line that was manually drawn.
                  Code:
                   protected override void OnBarUpdate()
                  {
                      foreach (IDrawObject draw in DrawObjects)
                      {
                          //Print(draw.DrawType.ToString()); //prints out all the drawn objects on the chart
                  				
                          if(draw.DrawType.ToString() == "Line")
                  	{
                  		ILine l = (ILine)draw as ILine;
                  		Print(l.EndY.ToString());
                  	}
                        }
                   }
                  Please let me know if I may be of additional assistance.
                  JesseNinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by bmartz, 03-12-2024, 06:12 AM
                  5 responses
                  32 views
                  0 likes
                  Last Post NinjaTrader_Zachary  
                  Started by Aviram Y, Today, 05:29 AM
                  4 responses
                  13 views
                  0 likes
                  Last Post Aviram Y  
                  Started by algospoke, 04-17-2024, 06:40 PM
                  3 responses
                  28 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by gentlebenthebear, Today, 01:30 AM
                  1 response
                  8 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by cls71, Today, 04:45 AM
                  1 response
                  7 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X