NinjaTrader Support Forum  

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

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 02-23-2010, 07:57 AM   #1
dhunnewell
Member
 
Join Date: Jan 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default Get user input?

I am new to Ninja Trader and I am writing scripts for someone else, I have written a script that adds a data series to a chart... I want to get user input for The script initialize to use as the time base for the new data series... I am lost and cannot find anything script reference.

This is the initialize of my script:

Code:
 
protected override void Initialize()
{
Add(PeriodType.Minute, 600); 
CalculateOnBarClose = false;
}
I want to get user input for "period".

Is it possible to get user input?
Last edited by dhunnewell; 02-23-2010 at 08:47 AM.
dhunnewell is offline  
Reply With Quote
Old 02-23-2010, 08:50 AM   #2
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

Unfortunately not for bar creation. You will need to hard code it.
NinjaTrader_Josh is offline  
Reply With Quote
Old 02-23-2010, 12:59 PM   #3
dhunnewell
Member
 
Join Date: Jan 2008
Posts: 32
Thanks: 0
Thanked 0 times in 0 posts
Default

Thanx!, New problem... hope you can help...

Here is my script mod:

Code:
 
#region Using declarations
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
namespace NinjaTrader.Strategy
{
[Description("Plots fibonacci extension of previous bar on current bar and indicates retrace.")]
public class MacdCon : Strategy
{
#region Variables
#endregion

/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
TextBoxRenderer.DrawTextBox(Graphics.FromHdc, Rectangle.FromLTRB, TextBoxState.Normal);
Problem is TextBoxState.Normal generates the following error:

The name 'TextBoxState' does not exist in the current context.

Indeed when I refer to Intellisense it is not there!

Did I leave out a reference?
dhunnewell is offline  
Reply With Quote
Old 02-23-2010, 01:22 PM   #4
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 106 times in 70 posts
Default

dhunnewell,

This would be more of a general C# question. Unfortunately I do not know which "using" you would need to add for TextBoxes. Perhaps you could try googling it.
NinjaTrader_Josh 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
Initialize value of Time Series in a Strategy Jean-Marc-Molina Strategy Development 3 10-15-2009 11:26 AM
DataSeries input to indicator in strategy Initialize() routine trader20 Strategy Development 2 07-16-2009 06:03 AM
How to access user defined inuts in initialize function. oblix General Programming 3 06-03-2009 02:46 PM
DataSeries as User Input SystemTrading Strategy Development 3 02-03-2009 10:39 AM
Input Series For Indicator CraigC Indicator Development 7 06-28-2008 03:58 AM


All times are GMT -6. The time now is 02:29 PM.