NinjaTrader Support Forum  

Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 04-25-2012, 03:09 PM   #1
roland_nt
Senior Member
 
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
Default Read in GUI parameter values from text file

I would like to be able to read in a variety of GUI values from a text file during the OnStartup() routine.
These values would have been ones that are saved from a prior run of the indicator, perhaps by using Streamwriter facilities..

The need arises during refinement of an indicator with a large number of "Parameters" in the indicator start up GUI.
It gets really tedious to put in by hand 25 variable values different from the default values every time the indicator is reloaded.
A typical approach might be a file organized as name = value pairs, e.g.
span=24
length=18
stop=0.75
and so on.
However the exact format is not critical as long as there is some kind of syntax that can capture new values which would override the default parameter values during OnStartup().

Bottom line, I want to be able to save the state of changed "Parameters" and restore them at a later time.
Any leads would be much appreciated
roland_nt is offline  
Reply With Quote
Old 04-25-2012, 03:24 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,858
Thanks: 162
Thanked 579 times in 570 posts
Default

Hello,

Yes this would be possible but wouldn't require StreamWriter to do so.

If you have not yet, please take a look at our reference sample on Using System.IO File properties to write to and read from a text file

http://www.ninjatrader.com/support/f...ead.php?t=3477
NinjaTrader_Matthew is offline  
Reply With Quote
Old 04-25-2012, 06:51 PM   #3
roland_nt
Senior Member
 
Join Date: Feb 2008
Posts: 108
Thanks: 0
Thanked 0 times in 0 posts
Default Read in GUI parameter values from text file

Mathew:
Thanks for very quick response.
The sample perfectly outlines what I need to do.
Much appreciated
Roland
roland_nt 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
Cannot read text using text tool on black chart background Billy Valentine Charting 6 12-07-2012 11:07 AM
How to make parameter read-only cassb Version 7 Beta General Questions & Bug Reports 15 04-15-2010 10:12 AM
Write the values of an indicator to a text file mat1024 Indicator Development 4 03-22-2010 01:45 PM
Indicator: Using System.IO File properties to write to and read from a text file NinjaTrader_Josh Reference Samples 0 09-30-2007 10:48 PM
Indicator: Using StreamReader to read from a text file NinjaTrader_Josh Reference Samples 0 09-30-2007 10:42 PM


All times are GMT -6. The time now is 07:01 PM.