• 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

Custom Properties

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

    Custom Properties

    Hi I am looking into creating a Ninja Script that will hide drawing objects from specific time frame charts.

    For example if I draw a box on a 60minute time frame of an instrument chart, I do not want that same box displayed on the Day time frame chart of the same instrument. The reason is less clutter on the larger time frames so analysis is faster.

    I want to apply the rule/property at the time an object is being drawn so I can target specific objects rather than working with all objects, and I'd like to target specific time frame to prevent having to turn objects on and off when moving between time frames.

    While I know I will eventually work out how to code this feature as a script, I was wondering if anyone else has developed a script already that achieves this, or has worked out how to apply custom properties to drawing objects without the need for scripted code?

    One approach I am thinking about is obviously to take advantage of the connected charts in NJ8, and have larger time frames separated from smaller ones on separate charts (on multiple screens). The issue for me there, is I draw support and resistance lines on the higher time frames I want represented on the lower trading time frames. So unless there is a way to transpose drawing objects between charts, this connected chart method is not the answer for me?

    Kind regards

    Duncan

    #2
    Hello EastLondonKiwi, and thank you for your question. Probably the easiest way to do this would be to paint any chart objects you draw with a color that changes to transparent when an undesired BarsPeriod is present. Here is a code example which generates such a color dynamically.

    Code:
                BarsPeriod period = ChartBars.Properties.BarsPeriod;
                bool visible = (
                       ( period.BarsPeriodType == BarsPeriodType.Minute )
                    && ( period.BarsPeriodValue == 1 )
                    );
                Brush boxColor =
                      visible
                    ? Brushes.ForestGreen
                    : Brushes.Transparent
                    ;
    This example was developed using this information from the help guide :

    http://ninjatrader.com/support/helpG...properties.htm

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      ok thanks I'll take a look at the help guide on this subject and let you know how I got on.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by johnnybegoode, Today, 11:35 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by NickyD, Today, 09:07 AM
      3 responses
      14 views
      0 likes
      Last Post NickyD
      by NickyD
       
      Started by 7robert, Today, 06:46 AM
      3 responses
      62 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by ElMagoR, Today, 07:49 AM
      4 responses
      31 views
      0 likes
      Last Post NinjaTrader_ChrisL  
      Started by Nabil, 09-13-2019, 11:44 AM
      5 responses
      35 views
      0 likes
      Last Post Nabil
      by Nabil
       
      Working...
      X