Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Point and Figure Bars Type...
Collapse
X
-
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.Tags: None
-
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:
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.PointAndFigure }; }
The syntax above can be generated automatically using the following steps:Code:if (State == State.SetDefaults) { BarsPeriod = new BarsPeriod { BarsPeriodType = (BarsPeriodType) 14, BarsPeriodTypeName = "MyCustomBarsType(14)", Value = 1 }; }- 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.
-
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
Modified:Code:if (State == State.SetDefaults) { ChartStyleType = ChartStyleType.PointAndFigure; }
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.Code:if (State == State.SetDefaults) { ChartStyleType = (ChartStyleType) 8; }
I look forward to being of further assistance.
Comment
-
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:
The ChartStyle shows up in the drop down on the chart. I *assume* the ChartStyle inherits the BarsType, is this correct?Code:if (State == State.SetDefaults) { Name = @"MyPnfChartStyle"; ChartStyleType = (ChartStyleType) 9; }Last edited by funk101; 05-16-2016, 08:25 AM.
Comment
-
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:
In the ChartStyle, you will see:Code:DefaultChartStyle = Gui.Chart.[B]ChartStyleType[/B].PointAndFigure;
Based on how these match, you can replicate that with the new custom types you make:Code:ChartStyleType = [B]ChartStyleType[/B].PointAndFigure;
You made a ChartStyle with:
Therefore the bar type would need to match this type:Code:ChartStyleType = (ChartStyleType) 9;
This should just relate what ChartStyle is selected by default when configuring the BarType.Code:DefaultChartStyle = (Gui.Chart.ChartStyleType) 9;
I look forward to being of further assistance.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
650 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
577 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment