NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM 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 03-12-2011, 07:18 AM   #1
DionysusToast
Senior Member
 
Join Date: Jul 2010
Location: Bangkok
Posts: 162
Thanks: 4
Thanked 38 times in 12 posts
Default Setting Parameters to be saved with an indicator - when is too late?

All

I want to reset some of the indicator settings in my code.

I can do this - it works well and it saves the settings fine.

Now I'm trying to do this when the indicator/workspace/chart/Ninja is being closed. So - when they close the indicator, I'd like to have an event in which I execute some code.

The OnTermination event does allow me to execute code but it appears this is too late to make changes to the indicator settings - I would guess that's because they've already been saved.

So - is there an even that will trigger when the indicator is being closed but before Ninja has saved away all the settings?

Thanks

Pete
DionysusToast is offline  
Reply With Quote
Old 03-12-2011, 10:33 AM   #2
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Thanks for your forum post.


There is not a method I am aware of that will allow you to do this other then OnTermination().However I will double check on this on Monday with some other members of our NinjaScript support team.

The only thing I can recommend is that you instead, in OnTermination() save this information to a .txt file or some external file such as using excel like in your excellent write up several months ago on using excel, or using a .txt file.

Then in Init() or OnStartUp() for your indicator/strategy then you could always load in the data from this external file.
NinjaTrader_Brett is offline  
Reply With Quote
Old 03-12-2011, 08:30 PM   #3
DionysusToast
Senior Member
 
Join Date: Jul 2010
Location: Bangkok
Posts: 162
Thanks: 4
Thanked 38 times in 12 posts
Default

Brett

Thanks for that - the problem with that approach is that I might be runing my indicator multiple times and so I'd need to somehow have an index value so that I would know which text file relates to which instance of the indicator.

I believe there's no way to 'id' a particular instance of an indicator.

Anyway - I'd appreciate it if you could talk to dev team. I guess I could do this on every tick but that would mean a performance hit.

If there is a way to put some code into the save process or an event that comes before it, it's be useful for me.

Cheers

Pete
DionysusToast is offline  
Reply With Quote
Old 03-14-2011, 08:59 AM   #4
NinjaTrader_Brett
NinjaTrader Customer Service
 
NinjaTrader_Brett's Avatar
 
Join Date: Dec 2009
Location: Denver, CO, USA
Posts: 6,498
Thanks: 109
Thanked 291 times in 280 posts
Default

Hello,

Have discussed this over, Unfortunately there is no supported method to do this.
NinjaTrader_Brett 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
Setting order of Parameters in Indicator Box higler Indicator Development 2 02-01-2011 09:52 AM
setting the backtest dialogue parameters mtthwbrnd Strategy Analyzer 1 01-06-2010 05:02 AM
Setting optimization parameters sharkie Strategy Development 7 12-09-2009 08:09 AM
Error Log setting up parameters stefy Strategy Development 1 06-23-2009 09:10 AM
Setting EntryHandling || EntriesPerDirection From Program Overridden by BackTest Parameters KBJ Strategy Analyzer 4 05-01-2007 07:24 AM


All times are GMT -6. The time now is 08:42 PM.