![]() |
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Aug 2009
Location: Princeton NJ
Posts: 87
Thanks: 10
Thanked 0 times in 0 posts
|
I want to color price bars based on the value of the RSI. How should I construct the test to see if the value of the RSI is above or below the parameters the user selected for the upper and lower values? What variables hold the user selections for upper and lower parameters?
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
|
Hello,
These are found if you click on the grey Variables near the top of the code or the Properties box near the bottom. They are light grey.
Ben
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Aug 2009
Location: Princeton NJ
Posts: 87
Thanks: 10
Thanked 0 times in 0 posts
|
This is the variables section -
Code:
#region Variables private DataSeries avgUp; private DataSeries avgDown; private DataSeries down; private int period = 14; private int smooth = 3; private DataSeries up; #endregion This is the properties section - Code:
#region Properties
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Avg
{
get { return Values[1]; }
}
/// <summary>
/// </summary>
[Browsable(false)]
[XmlIgnore()]
public DataSeries Default
{
get { return Values[0]; }
}
/// <summary>
/// </summary>
[Description("Numbers of bars used for calculations")]
[Category("Parameters")]
public int Period
{
get { return period; }
set { period = Math.Max(2, value); }
}
/// <summary>
/// </summary>
[Description("Number of bars for smoothing")]
[Category("Parameters")]
public int Smooth
{
get { return smooth; }
set { smooth = Math.Max(1, value); }
}
#endregion
The RSI has two lines being drawn. The user can specify values for both the upper and lower lines. A gif of the settings that can be specifed by the user is attached. What variables would hold the value specified by the user for the upper and lower lines? What code would I use to test if the value of the RSI was above or below each of those two user specfied values. if RSI > ???????? or if RSI <= ?????????? Thanks |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,555
Thanks: 261
Thanked 1,013 times in 994 posts
|
drumholz, you could access those for example with this snippet call -
Code:
if (rsi > Lines[1].Value) ...
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Creating parameters for user input | NinjaTrader_Josh | Indicator Development | 13 | 08-12-2010 02:47 AM |
| User Defined Input Parameters | erikp | Suggestions And Feedback | 6 | 10-04-2009 10:02 AM |
| Accessing Misc parameters | ZenMachine | General Programming | 3 | 04-02-2009 03:29 PM |
| Accessing the user defined plot color parameter from within an indicator. | Elliott Wave | Indicator Development | 1 | 04-15-2008 11:29 PM |
| Creating User Defined Input Parameters | NinjaTrader_Josh | Tips | 0 | 02-23-2008 05:02 AM |