else if (State == State.Configure) { AddDataSeries(new BarsPeriod { BarsPeriodType = (BarsPeriodType) 123460, BarsPeriodTypeName = "JGRenkoBars", Value = _hTFRenkoBrickSize, Value2 = _hTFRenkoThreshold}); }
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Getting all details for a new data series.
Collapse
X
-
Getting all details for a new data series.
I have created my own Custom Bar for Renko. In my strategy I have the following code to add a secondary Data Series
Code:
Tags: None
-
Hello GARZONJ,
Thanks for your post.
Days To Load would only be available from the Data Series window. When using AddDataSeries, you could specify barsToLoad, but this will only affect the first added Data Series.
Changing the Price Based On parameter would involve using an AddDataSeries() overload that allows you to specify a MarketDataType.
Please see the AddDataSeries() documentation for a full list of overloads as well as a list of tips and advisories. Please also note that while using a variable in State.Configure will generally work in most cases, this is not supported and you may see an error "Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
Please let us know if you have any additional questions.JimNinjaTrader Customer Service
-
Jim,
Just so that I am clear:
Day to Load parameter
This parameter is only available in the Data Series configuration window. For my strategy I only configure the Primary Data Series using the configuration window. Do all additional Data Series added through the AddDataSeries method use the same Day To Load as the primary Data Series?
Price Based On parameter
As you can see from my sample code included in the original post, I am using a custom bar type. Could you tell me how do I overload the marketDataType parameter when working with custom bar type? I have tried it many ways and I get all types of errors. Please advice.
Thanks,
Comment
-
Hello GARZONJ,
Unless it is the first data series added that uses the barsToLoad overload, data will be requested to match when the primary data series starts.
For your case, since you are using a BarsPeriod parameter, MarketDataType can be set within the BarsPeriod that you create.
Code:AddDataSeries(new BarsPeriod { BarsPeriodType = (BarsPeriodType) 123460, BarsPeriodTypeName = "JGRenkoBars", Value = _hTFRenkoBrickSize, Value2 = _hTFRenkoThreshold, MarketDataType = MarketDataType.Last});
Please let me know if there is anything else I can do to help.JimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by cmtjoancolmenero, Yesterday, 03:58 PM
|
1 response
17 views
0 likes
|
Last Post Today, 06:16 AM | ||
Started by benmarkal, Yesterday, 12:52 PM
|
3 responses
23 views
0 likes
|
Last Post Today, 05:22 AM | ||
Started by helpwanted, Today, 03:06 AM
|
1 response
19 views
0 likes
|
Last Post Today, 03:35 AM | ||
Started by Brevo, Today, 01:45 AM
|
0 responses
11 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
244 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
Comment