![]() |
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Apr 2008
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
Hi Folks, I've been trying to figure this out for several days and haven't had any luck.
I'm trying to get a list of my Parameters at run time (use on first bar routine in OnBarUpdate) so I can store the values in a data base. I want to do this so I can reuse the same technique with multiple strategies and keep a generic database of the parameters and let NT generate the appropriate SQL on the fly instead of having to rewrite it myself every time a change a parameter. Clearly NT does this since we can give the Parameters values in Backtest, Optimize and Walkforward. I've tried various things around the Category attribute. Any ideas? Thanks! |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Feb 2008
Location: www.integratedtradingtech.com
Posts: 270
Thanks: 1
Thanked 80 times in 64 posts
|
You could try something like this.
Code:
IndicatorBase[] ib = ChartControl.Indicators;
foreach (var item in ib)
{
Print(item.ToString());
}
EMA(Typical of TF 06-11 (4 Range),34) MACD(TF 06-11 (4 Range),12,26,9) You would have to add the code you need in the foreach loop to store item.ToString() where you want it. BTW, putting it in OnStartUp() would be a better place than a routine in OnBarUpdate(). Hope this helps. VT |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Apr 2008
Posts: 27
Thanks: 0
Thanked 0 times in 0 posts
|
Thanks VT,
This got me on the right track. What I needed was: foreach(Parameter p in Parameters) { Print(p.Name); } Seems I got sidetracked by Attributes. Thanks also for the OnStartUp() tip. Turns out this is the event I really needed. |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Different parameters for different instruments in a backtest on a list | adamus | Version 7 Beta General Questions & Bug Reports | 18 | 05-05-2010 11:24 AM |
| Access Instrument List | TraderGuy | General Programming | 1 | 12-26-2008 04:01 PM |
| Programmatic access to account value? | andrewbee | General Programming | 1 | 12-09-2008 12:47 PM |
| Programmatic access to actual positions? | heech | General Programming | 1 | 12-04-2008 11:50 PM |
| Programmatic Access to all Power Volume Indicators | Forex Ninja | Suggestions And Feedback | 1 | 05-21-2007 08:24 AM |