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 08-29-2012, 06:45 PM   #1
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default The use of inputs

I want to have user inputs in a strategy. I would like the user to communicate with the program at his option. For example, let's say that the program is putting diamonds on a chart. Suppose the user doesn't want any more diamonds being placed on the chart. So, the user clicks on the chart and selects 'Strategies'. He selects his strategy then places an entry in an input. The software will interpret this in such a way as to prevent diamonds from being drawn on the chart. At a later time, the user enters into the input and the diamonds now begin appeariung again. Like a toggle.

I tried to use the default myInput0 and change its value within the program.
myInput0=8; When another bar formed I checked the input value from the chart. It didn't change to 8 until I highlighted the strategy. However, I cannot enter another number into the input. It is locked out.

Suggestions?

Thank you...
dukeb is offline  
Reply With Quote
Old 08-29-2012, 06:49 PM   #2
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,856
Thanks: 162
Thanked 579 times in 570 posts
Default

Duke,

I'd suggest using Boolean methods which can be set to True or False.

if(ShowDiamonds == true)
//logic w/ DrawDiamonds()

if(ShowDiamonds == false)
//logic w/o DrawDiamonds()
NinjaTrader_Matthew is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Matthew for this post:
Old 08-29-2012, 06:57 PM   #3
dukeb
Senior Member
 
Join Date: Mar 2012
Posts: 102
Thanks: 29
Thanked 4 times in 4 posts
Default

Matthew,
After the strategy is up and running can I click on the chart and select the strategy then change the inputs and have the software react to this on an interactive basis without stopping the processing within the software?
Duke
dukeb is offline  
Reply With Quote
Old 08-29-2012, 07:01 PM   #4
NinjaTrader_Matthew
NinjaTrader Customer Service
 
NinjaTrader_Matthew's Avatar
 
Join Date: Apr 2010
Location: Denver, CO, USA
Posts: 4,856
Thanks: 162
Thanked 579 times in 570 posts
Default

You cannot change a strategy parameter on a running strategy.

You can do this on an indicator, but for a strategy you would need to disable and then re-enable the strategy.
NinjaTrader_Matthew is offline  
Reply With Quote
The following user says thank you to NinjaTrader_Matthew for this post:
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
Inputs for indicators Radical Indicator Development 6 12-06-2011 02:11 PM
Inputs[1] zeller4 Indicator Development 7 07-21-2011 10:29 AM
Arranging inputs Hawk Arps General Programming 1 06-23-2011 10:46 AM
Inputs[] MikeInMA General Programming 3 09-03-2010 09:02 AM
Too many inputs! eDanny Indicator Development 6 07-25-2008 09:25 AM


All times are GMT -6. The time now is 11:52 PM.