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:
Code:if (State == State.SetDefaults) { BarsPeriod = new BarsPeriod { BarsPeriodType = BarsPeriodType.PointAndFigure }; }
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.JesseNinjaTrader Customer Service
-
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; }
Code:if (State == State.SetDefaults) { ChartStyleType = (ChartStyleType) 8; }
I look forward to being of further assistance.JesseNinjaTrader Customer Service
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:
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:
Code:DefaultChartStyle = Gui.Chart.[B]ChartStyleType[/B].PointAndFigure;
Code:ChartStyleType = [B]ChartStyleType[/B].PointAndFigure;
You made a ChartStyle with:
Code:ChartStyleType = (ChartStyleType) 9;
Code:DefaultChartStyle = (Gui.Chart.ChartStyleType) 9;
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by rajendrasubedi2023, Today, 09:50 AM
|
0 responses
7 views
0 likes
|
Last Post Today, 09:50 AM | ||
Started by ender_wiggum, Today, 09:50 AM
|
0 responses
3 views
0 likes
|
Last Post
by ender_wiggum
Today, 09:50 AM
|
||
Started by bmartz, Today, 09:30 AM
|
1 response
7 views
0 likes
|
Last Post Today, 09:48 AM | ||
Started by geddyisodin, Today, 05:20 AM
|
3 responses
24 views
0 likes
|
Last Post Today, 09:36 AM | ||
Started by lorem, Today, 09:18 AM
|
1 response
5 views
0 likes
|
Last Post
by lorem
Today, 09:30 AM
|
Comment