NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > Application Technical Support > Automated Trading

Automated Trading Support for automated trading systems using NinjaScript. Support for our ATI (Automated Trading Interface) used to link an external application such as TradeStation and eSignal to NinjaTrader.

Reply
 
Thread Tools Display Modes
Old 04-26-2011, 08:40 AM   #1
sosMsos
Member
 
Join Date: Aug 2010
Posts: 43
Thanks: 0
Thanked 0 times in 0 posts
Default no user input recognition

I have replaced my RSI periods with input variables, to see if i can optimize the periods i chose.
But now somehow NT does not recognize my input variables for optimization:
(there is nothing to optimize)


{
#region Variables
// Wizard generated variables
private int rSI01 = 4; // Default setting for rSI01
private int rSI02 = 9; // Default setting for rSI02

// User defined variables (add any user defined variables below)
#endregion

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
Add(RSI(rSI01, 0));
Add(RSI(rSI02, 0));

Add(EMA(21));
Add(EMA(55));
Add(EMA(200));
Add(ATR(14));
//SetStopLoss("",CalculationMode.Ticks, (ATR(14)[0]) * (250), false);

CalculateOnBarClose = true;

}

/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// Condition set 1
if (EMA(21)[0] > EMA(55)[0]
&& EMA(55)[0] > EMA(200)[0]
&& EMA(55)[0] > EMA(55)[1]
&& EMA(200)[0] > EMA(200)[1]
// CrossBelow(Low, EMA(21), 1))
&& CrossBelow(RSI(rSI01, 0).Avg, 30, 1))
{
EnterLong(DefaultQuantity, "");
}
SetStopLoss("",CalculationMode.Ticks, (ATR(14)[0]) * (250), false);

// Condition set 2
if (CrossAbove(RSI(rSI01, 0).Avg, 75, 1))
{
ExitLong("");
}
sosMsos is offline  
Reply With Quote
Old 04-26-2011, 08:43 AM   #2
NinjaTrader_RyanM
NinjaTrader Customer Service
 
NinjaTrader_RyanM's Avatar
 
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
Default

Hello sosMsos,

In addition to the private declaration there, you need it declared as public in the properties region. This structure is provided for you automatically when you create inputs through the wizard, but you can also add with code. This post can help with the needed properties structure.
http://www.ninjatrader.com/support/f...ead.php?t=5782
NinjaTrader_RyanM is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
User input box UManiac Indicator Development 2 09-21-2010 02:28 PM
User Input exception symphys General Programming 1 02-25-2010 07:03 AM
User Defined Input Parameters erikp Suggestions And Feedback 6 10-04-2009 10:02 AM
DataSeries as User Input SystemTrading Strategy Development 3 02-03-2009 10:39 AM
how to changing user input value easier MoreYummy Automated Trading 0 08-31-2008 10:34 PM


All times are GMT -6. The time now is 05:15 AM.