Does anyone know if there is any way to set the PriceType default value in NT 7? Currently the PriceType defaults to Close. I would like to set it to something other than Close, say Median, yet still allow the user the option to change it. I have searched the forum and have not found any information on this. Thank you.
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
Default PriceType
Collapse
X
-
Default PriceType
Hi,
Does anyone know if there is any way to set the PriceType default value in NT 7? Currently the PriceType defaults to Close. I would like to set it to something other than Close, say Median, yet still allow the user the option to change it. I have searched the forum and have not found any information on this. Thank you.Tags: None
-
Hi Ryan,
Thank you for your reply but I don't think that this will do what I need. First, I want the PriceType to apply to the Imput Data series, not any specific plot. Second, if I code the PriceType in the Initialize() as suggested, the user will never be able to change it,- it will always reset to the coded value. I would like to change the default PriceType for the Input Data series and still give the user the option to change it. So, I want the same behaviour we have now, except I want to change the PriceType default value from Close to Median.
Comment
-
Attached is a sample that shows how this works, which matches your description as far as I can tell.Attached FilesLast edited by NinjaTrader_RyanM1; 03-15-2011, 10:28 AM.Ryan M.NinjaTrader Customer Service
Comment
-
Hi Ryan,
Thank you very much, I really appreciate this.
I have two quick questions if I may:
1. The code states:
// Use this method for calculating your indicator values. Assign a value to each
// plot below by replacing 'Close[0]' with your own formula.
Plot0.Set(Input[0]);
What Close[0] are you referring to in here?
2. On a sligtly different, yet related note, if I wanted to say multiply the INput series values by 3, would I use the same program construct? For example, replace
Plot0.Set(Input[0]);
with
Plot0.Set(3*Input[0]);
How would I access these new values elsewhere in the program?
Thank you for your help. It is much appreciated.
Comment
-
Thanks for the reply. It does look like you are locked into the selection specified in Initialize() method for PriceType. Unfortunately there is currently no way to assign a default and allow user to change.
You can make a new data series for your input. This sample can help with custom data series.
#region Variables
private DataSeries myDataSeries;
#endregion
protected override void Initialize()
{
myDataSeries = new DataSeries (this);
}
protected override void OnBarUpdate()
{
myDataSeries.Set(Input[0] * 3);
}
I also removed comments in the sample if they were confusing to you. Those are the standard comments that come whenever you create a new indicator.Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ageeholdings, Today, 07:43 AM
|
0 responses
6 views
0 likes
|
Last Post
by ageeholdings
Today, 07:43 AM
|
||
Started by pibrew, Today, 06:37 AM
|
0 responses
4 views
0 likes
|
Last Post
by pibrew
Today, 06:37 AM
|
||
Started by rbeckmann05, Yesterday, 06:48 PM
|
1 response
14 views
0 likes
|
Last Post
by bltdavid
Today, 05:43 AM
|
||
Started by llanqui, Today, 03:53 AM
|
0 responses
6 views
0 likes
|
Last Post
by llanqui
Today, 03:53 AM
|
||
Started by burtoninlondon, Today, 12:38 AM
|
0 responses
12 views
0 likes
|
Last Post Today, 12:38 AM |
Comment