Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Point and Figure Bars Type...

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

    Point and Figure Bars Type...

    I'm working on modifying NT's Point And Figure charts to allow for *proper* 1 box reversal charts. In order to do so, I believe I need to dig into the "PointAndFigureBarsType" code. I've made a copy of the bars type -> "MyPointAndFigureBarsType", but not sure how to tell the PointAndFigure "ChartStyle" to look at my version of the bars type instead of NT's. If you can point me in the right direction here it would be greatly appreciated.
    Thanks.

    #2
    Hello,

    I wanted to check, in the file you saved as, did you change the BarsPeriod to a custom period?

    The standard bar type has the following line:
    Code:
    if (State == State.SetDefaults)
    {
    	BarsPeriod = new BarsPeriod { BarsPeriodType = BarsPeriodType.PointAndFigure };
    }
    This would need to be changed to something like the following instead for it to be "different" or to show up in the menu correctly.
    Code:
    if (State == State.SetDefaults)
    {
    	BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 14, BarsPeriodTypeName = "MyCustomBarsType(14)", Value = 1 };
    }
    The syntax above can be generated automatically using the following steps:
    • In the NinjaScript editor, right click on BarTypes and click New.
    • Press Generate to create a new BarType file
    • Look for the BarsPeriod line and copy it.
    • Now close the file you just created and do not save it, you just need to create the file to see the BarsPeriod and then close the file.
    • Paste the copied bars period into the file you were originally working on.



    If this is not the case, it may be helpful as well to see the syntax used in the copy to know why it is not showing up in the menu, this is just the most common reason a bar type would not appear.

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

    Comment


      #3
      Ok, I've made that change, now in the "ChartStyle", which I named "MyPnfChartStyle" I *assume* I need to set my "custom" Bars Type here. Not sure where/how to do this. Am I making sense?

      Comment


        #4
        Hello,

        Thank you for the reply.

        I am sorry the prior reply was specific to the PointAndFigure Bar type rather than the chart style, for a ChartStyle instead you would need to make the following change:
        Original
        Code:
        if (State == State.SetDefaults)
        {
            ChartStyleType	= ChartStyleType.PointAndFigure;
        }
        Modified:
        Code:
        if (State == State.SetDefaults)
        {
             ChartStyleType = (ChartStyleType) 8;
        }
        The steps to discover the last index (the 8 in the above example) would be the same as a bar type, mainly create a new chart style, copy the one line, close the new file without saving.

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

        Comment


          #5
          Ok, let me re-explain:

          I have my custom BarType -> "MyPointAndFigureBarType"
          I have my custom ChartStyle -> "MyPnfChartStyle"

          in "MyPointAndFigureBarType" the code has this:
          Code:
          if (State == State.SetDefaults)
          {
          	Name						= @"MyPointAndFigureBarsType";
          	BarsPeriod					= new BarsPeriod { BarsPeriodType = (BarsPeriodType) 14, BarsPeriodTypeName = "MyPointAndFigureBarsType(14)", Value = 1 };
          	DaysToLoad					= 5;
          	[b]DefaultChartStyle			        = Gui.Chart.ChartStyleType.PointAndFigure;[/b]
          			}

          in "MyPnfChartStyle" the code has this:
          Code:
          if (State == State.SetDefaults)
          {
          	Name			= @"MyPnfChartStyle";
          	ChartStyleType	= (ChartStyleType) 9;
          }
          The ChartStyle shows up in the drop down on the chart. I *assume* the ChartStyle inherits the BarsType, is this correct?
          Last edited by funk101; 05-16-2016, 08:25 AM.

          Comment


            #6
            Hello,

            You would need to make sure the Types match, everything for BarTypes and ChartStyles relates to its Type to be Unique and also how you will locate it.

            Lets review the Default styles and how they work, based on how they work you can replicate that using your own code instead to make a Unique type.

            The BarType defines:
            Code:
            DefaultChartStyle	= Gui.Chart.[B]ChartStyleType[/B].PointAndFigure;
            In the ChartStyle, you will see:
            Code:
            ChartStyleType = [B]ChartStyleType[/B].PointAndFigure;
            Based on how these match, you can replicate that with the new custom types you make:

            You made a ChartStyle with:
            Code:
            ChartStyleType	= (ChartStyleType) 9;
            Therefore the bar type would need to match this type:
            Code:
            DefaultChartStyle = (Gui.Chart.ChartStyleType) 9;
            This should just relate what ChartStyle is selected by default when configuring the BarType.

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

            Comment


              #7
              Yup, that's it, thanks!

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by rajendrasubedi2023, Today, 09:50 AM
              0 responses
              7 views
              0 likes
              Last Post rajendrasubedi2023  
              Started by ender_wiggum, Today, 09:50 AM
              0 responses
              3 views
              0 likes
              Last Post ender_wiggum  
              Started by bmartz, Today, 09:30 AM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Erick  
              Started by geddyisodin, Today, 05:20 AM
              3 responses
              24 views
              0 likes
              Last Post NinjaTrader_Gaby  
              Started by lorem, Today, 09:18 AM
              1 response
              5 views
              0 likes
              Last Post lorem
              by lorem
               
              Working...
              X