• 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

BarsType

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

    BarsType

    Hello,

    I´m using for years my simple indicator showing me the instrument and the period directly in the chart.

    DrawTextFixed("Instrument", Instrument.MasterInstrument.Name.ToString() + ", " + BarsPeriod.Value, + BarsPeriod.BarsType, TextPosition.BottomLeft,Color.Black, new Font ("Arial",10), Color.Black,Color.White,10);

    When adding here the BarsType I get errormessages when compiling whatever I try from the link https://ninjatrader.com/support/help...barsperiod.htm

    Thank you!
    Tony


    #2
    Hello tonynt,

    Are you trying to use DrawTextFixed directly from the BarsType or are you trying to use the Instrument object?

    Drawing objects specifically would not be able to be used in a BarsType, a BarsType is not meant to render anything.

    The instrument would also need to be found using the Bars object which comes in from Add.

    Code:
    bars.Instrument.MasterInstrument
    Because this is not a supported/documented concept for 7 you could refer to the Documents\NinjaTrader 7\bin\Custom\Type\@BarsTypes.cs file for some examples of existing bars types and how they access Instrument properties.

    Indicators and BarsTypes are not equal in how they work and do not share alike properties so a majority of the code used in Indicators will not work here. If the goal is to render text for the BarsType that would not be able to be accomplished from the BarsType, you could use either a ChartStyle to custom render based on bar data or an indicator as you are now. BarsTypes and ChartStyles are not documented for NT7 so there is not much that I can provide for help content on this subject, you can review the @BarsTypes.cs file and @ChartStyles.cs file.







    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you for your reply. Sorry, but I have no idea what you mean and what is not able.

      I have my indicator working for years and in OnBarUpDate I have
      DrawTextFixed("Instrument", Instrument.MasterInstrument.Name.ToString() + ", " + BarsPeriod.Value, TextPosition.BottomLeft,Color.Black, new Font ("Arial",10), Color.Black,Color.White,10);
      which is plotting OK.

      I simply want to add that behind the "...Value" it shows "Minute" or "Day" or "Range" or "Ticks" (from the dataseries used in that chart)

      Thank you!
      Tony

      Comment


        #4
        Hello tonynt,

        Are you asking to use the drawing in a BarsType? A BarsType cannot use drawing objects if so.

        If you want to access the BarsPeriod you would need to view how the other BarsType utilize that value in their code.

        bars.Period

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

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by herkok, Today, 09:15 AM
        2 responses
        16 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by KNalley, Today, 09:33 AM
        0 responses
        5 views
        0 likes
        Last Post KNalley
        by KNalley
         
        Started by AMATX, Today, 09:29 AM
        0 responses
        7 views
        0 likes
        Last Post AMATX
        by AMATX
         
        Started by arnegockeln, Today, 09:25 AM
        0 responses
        2 views
        0 likes
        Last Post arnegockeln  
        Started by itrader46, Today, 07:51 AM
        2 responses
        21 views
        0 likes
        Last Post NinjaTrader_ChrisL  
        Working...
        X