NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > General Programming

General Programming General NinjaScript programming questions.

Reply
 
Thread Tools Display Modes
Old 11-04-2011, 08:30 AM   #1
Mannygags
Member
 
Join Date: Jan 2009
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default Missing variable in Srategy

Hi. I have been working with and fine tuning a strategy of mine. I just recently added a variable to my existing list, but I can't seem to get Ninja to recognize it when I pull up the strategy to backtest or run in simulation mode. It is acting as if it is not there. I have compiled and saved the strategy and each time I open the strategy to edit, I can see it in the code, but it does not seem to get recognized by Ninja.

Do I need to perform another step to get it recognized somehow?

Thanks
Mannygags is offline  
Reply With Quote
Old 11-04-2011, 08:51 AM   #2
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Mannygags,

I am happy to assist you.

Yes, there is an additional step if you simply added a variable to the code.

If you look at the section : Properties at the bottom of the editor when you have the strategy open, then expand it by clicking the "+" icon to the left, it will show necessary code for user defined variables.

It looks something like this :

Code:
        #region Properties
        [Description("")]
        [GridCategory("Parameters")]
        public int Fast
        {
            get { return fast; }
            set { fast = Math.Max(1, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int Slow
        {
            get { return slow; }
            set { slow = Math.Max(1, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int StopLoss
        {
            get { return stopLoss; }
            set { stopLoss = Math.Max(1, value); }
        }

        [Description("")]
        [GridCategory("Parameters")]
        public int TakeProfit
        {
            get { return takeProfit; }
            set { takeProfit = Math.Max(1, value); }
        }
        #endregion
Please let me know if I may assist further.
NinjaTrader_AdamP is offline  
Reply With Quote
Old 11-04-2011, 09:25 AM   #3
Mannygags
Member
 
Join Date: Jan 2009
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanks! That's what I needed.
Mannygags is offline  
Reply With Quote
Old 11-04-2011, 09:27 AM   #4
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Mannygags,

You're welcome.

Please don't hesitate to contact us should you require additional assistance.
NinjaTrader_AdamP is offline  
Reply With Quote
Old 11-04-2011, 10:39 AM   #5
Mannygags
Member
 
Join Date: Jan 2009
Posts: 31
Thanks: 0
Thanked 0 times in 0 posts
Default

Another quick question. I am looking at purchasing a new amchine to trade on. Is Ninja supported on Windows 7? Are there any known issues?

Thanks again.
Mannygags is offline  
Reply With Quote
Old 11-04-2011, 10:45 AM   #6
NinjaTrader_AdamP
NinjaTrader Customer Service
 
NinjaTrader_AdamP's Avatar
 
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
Default

Mannygags,

NinjaTrader works in WIndows XP/Vista and 7. There are no known issues in using it across platforms.

Please let me know if I may assist further.
NinjaTrader_AdamP 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
Variable problem RickStevenson1 Strategy Development 5 05-17-2010 06:25 AM
Variable Persistence FatCanary Strategy Development 4 04-28-2010 02:02 PM
Expression As Variable JT454 General Programming 2 02-25-2010 09:23 AM
Srategy terminated "price below stop price" How can I fix? ninjablanks Automated Trading 2 06-08-2009 06:37 AM
Variable in Wizard Stainless2000 Strategy Development 3 08-29-2008 02:23 PM


All times are GMT -6. The time now is 02:01 AM.