![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Miscellaneous Support Miscellaneous support issues. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
|
I seem to be missing something here.
I can't get NinjaScript to work at all. I'm just trying to get it to print Hi at the output window and ever time I add anything to the bottom of what is below I will get an error. If I figure this out tonight I will repost. Putting // with comments if just fine but anything else results in an error, usually Namespace Member Declaration Expected. Thanks to any replies. -Stephen #region Using declarations using System; using System.ComponentModel; using System.Diagnostics; using System.Drawing; using System.Drawing.Drawing2D; using System.Xml.Serialization; using NinjaTrader.Cbi; using NinjaTrader.Data; using NinjaTrader.Gui.Chart; #endregion // This namespace holds all indicators and is required. Do not change it. namespace NinjaTrader.Indicator { /// <summary> /// Enter the description of your new custom indicator here /// </summary> [Description("Enter the description of your new custom indicator here")] public class MyCustomIndicator : Indicator { #region Variables // Wizard generated variables private int myInput0 = 1; // Default setting for MyInput0 // User defined variables (add any user defined variables below) #endregion /// <summary> /// This method is used to configure the indicator and is called once before any bar data is loaded. /// </summary> protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0")); CalculateOnBarClose = true; Overlay = false; PriceTypeSupported = false; } /// <summary> /// Called on each bar update event (incoming tick) /// </summary> protected override void OnBarUpdate() { // Use this method for calculating your indicator values. Assign a value to each // plot below by replacing 'Close[0]' with your own formula. Plot0.Set(Close[0]); } #region Properties [Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove [XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove public DataSeries Plot0 { get { return Values[0]; } } [Description("")] [Category("Parameters")] public int MyInput0 { get { return myInput0; } set { myInput0 = Math.Max(1, value); } } #endregion } } |
|
|
|
|
|
#2 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Try deleting this script and start again.
Close it, then select Tools > Edit NinjaScript > Indicator > selec this and press Delete button.
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#3 | |
|
Senior Member
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
|
Quote:
This is the program I wish to use: //Either/Or decision int x=1; if (x==0) { Print("Hi"); } else { Print("Buy"); } >>>>>>>>>>>>> Sorry.. Might be on the wrong screen, but I don't think you want me to delete all the NinjaTrader indicators??
Last edited by stephenszpak; 05-24-2008 at 05:38 PM.
|
|
|
|
|
|
|
#4 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
I wanted you to delete the indicator causing the issue and start from scratch.
Here is a reference for debugging compile errors. http://www.ninjatrader-support.com/v...ead.php?t=4678
Ray
NinjaTrader Customer Service |
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
|
Quote:
Thanks, there is no indicator to my knowledge. I'm just trying to get some of the simple programs at "Getting Started with NinjaScript- Basic Syntax" to run. The program below is just 10 lines of code. I think I must be putting it in the wrong screen or something. Sorry this is so confusing to us. Is it possible for you to post an image of what I should be seeing on my computer and also where to add my short program within the image? -Stephen
Last edited by stephenszpak; 05-24-2008 at 08:59 PM.
|
|
|
|
|
|
|
#6 |
|
Administrator
Join Date: Nov 2004
Location: Denver, CO, USA
Posts: 11,163
Thanks: 6
Thanked 45 times in 32 posts
|
Stephen,
What you should be seing is "no errors". - Shut down NT - Restart - Tools > Edit NinjaScript > Indicator - Select "any" indicator, press F5 ---> Does it compile? - NO, then delete the problem files as per my earlier messages/links - YES, great then there is no problem
Ray
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script is Script is Script | Json | Suggestions And Feedback | 19 | 04-23-2008 08:23 AM |
| tradestation script | frankvdplas | Miscellaneous Support | 1 | 02-19-2008 02:08 AM |
| Script conversion | ronblack | Strategy Development | 3 | 12-02-2007 09:55 AM |
| Add API instruction in the script. | khawaja | Automated Trading | 10 | 10-31-2007 01:46 PM |
| Help with my first script (3 bar reversal) | ClydeMacLeod | General Programming | 4 | 10-21-2007 05:58 AM |