![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Nov 2006
Location: , ,
Posts: 73
Thanks: 0
Thanked 0 times in 0 posts
|
Hi. I tried to pass an integer value to the Add function to populate the period parameter, but it did not work.
// where my_int is declared as a int variable my_int = 5; Add(PeriodType.Minute, my_int); Is there a way to accomplish the goal of calling Add with a variable value for period, rather than a static constant? Thank you. Regards, William |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Provided that the variable value my_int is the value you want prior to using it in the Add() method, this will work.
Try adding a Print(my_int) just before calling the Add() method to ensure the value is initialized as you expect.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: May 2007
Posts: 35
Thanks: 0
Thanked 0 times in 0 posts
|
Am I right in assuming that there is no way to use user supplied inputs in the Add method, as they are not available yet when Initialize is called?
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
You can use user inputs (properties) in the Add() method called within the Initialize() method.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Certified NinjaScript Consultant
|
Ray,
Could you please clarify your statement: Quote:
Regards, Whitmark |
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
I have never tried that in optimization. If you have and it does not work, then that is current expected behaviour.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Certified NinjaScript Consultant
|
As you can image, it can be pretty handy to use the optimizer to get a feel for the right combination of multiple timeframes or, for that matter, multiple instruments (enumerated of course) to be used within a strategy. Can we consider this for the enhancement list? Thanks.
Whitmark |
|
|
|
|
|
#8 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Yes, this is already on our list.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Aug 2007
Posts: 8
Thanks: 0
Thanked 0 times in 0 posts
|
Do you know which version and when the ETA is? I am very interested in this.
|
|
|
|
|
|
#10 |
|
Administrator
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
|
Unfortunately there no ETA available yet.
Dierk
NinjaTrader Customer Service |
|
|
|
|
|
#11 |
|
Certified NinjaScript Consultant
|
Has the ability to pass in the PeriodType and Period Size for a secondary series via a parameter AND allow these parameters to be iterated in the optimizer been considered yet for Version 7? Thanks.
Whitmark |
|
|
|
|
|
#12 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
|
Thanks for the note whitmark. We will put it on the list for considerations.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Swing Indicator Strength parameter | Kardinal | Charting | 1 | 07-06-2007 09:10 AM |
| Example for passing Time/Date as a Parameter | zoltran | General Programming | 7 | 05-17-2007 09:32 AM |
| Parameter selection lists | ThePatientOne | Indicator Development | 3 | 05-11-2007 08:48 AM |
| Parameter sorting/ordering | rtrader | Suggestions And Feedback | 3 | 04-08-2007 05:27 PM |
| Tradestation - passing in Account Numbers | jonno | Automated Trading | 1 | 12-20-2005 05:59 AM |