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 > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 05-10-2007, 09:20 AM   #1
Folls
Senior Member
 
Join Date: Jan 2006
Location: Chicago, Illinois, USA
Posts: 126
Thanks: 0
Thanked 1 time in 1 post
Default user settable input set incorrectly?

Hi,

When I use the wizard to generate a user settable input that defaults to a negative value, it gets set to 1 instead. This is verified after installing the strategy in a chart and looking at the input values.

Why does every set use Math.Max(1, value)? Can't it just use the value that is passed?

Code generated in variables section:
private int minSwingShort = -100; // Default setting for MinSwingShort

Code generated in properties section:
[Description("")]
[Category("Parameters")]
public int MinSwingShort
{
get { return minSwingShort; }
set { minSwingShort = Math.Max(1, value); }
}

Thanks,

Folls
Folls is offline  
Reply With Quote
Old 05-10-2007, 09:39 AM   #2
NinjaTrader_Ray
Administrator
 
NinjaTrader_Ray's Avatar
 
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
Default

When you define the Input in the Wizard, there is a "Min" value that you must set. By default this is 1. You need to change this to a min value that is less than -100.
NinjaTrader_Ray 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
Invalid User Password cabmanage Installation and Licensing 1 03-18-2007 01:27 AM
New user - automation question Steveinvest Automated Trading 2 11-21-2005 01:18 PM
User Manual PDF Format. Ripcat Miscellaneous Support 1 09-26-2005 09:03 AM
User Guide download tradingkevin Suggestions And Feedback 1 03-02-2005 07:02 PM
New user-can't get YM to load ron Miscellaneous Support 2 01-20-2005 03:23 AM


All times are GMT -6. The time now is 04:21 PM.