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 04-19-2008, 02:47 AM   #1
geoMEAN
Member
 
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
Question Indicator Namespace How Does It Work

If You = NT Staff, stop reading. You shouldn't use up your time answering this sort of question.... I understand C# is not supported here.

I've recently been trying to learn C# up to a level where I will feel comfortable coding Ninjascripts.

One exercise has been to look at the auto-generated code in ninjascript editor to learn.

Consider picture below. I'm wondering how the Ninjatrader.Indicator namespace is able to put together all the indicators used in Ninjatrader without having some sort of equilvalent of the "Partial" keyword that is sometimes used for a class where the class is defined in multiple files. In this example, my stupid "If Open=Close indicator" is the only indicator here. So just wondering from a programming perspective how C# knows to compile all the different indicators into the same Ninjatrader.Indicator namespace.

And yes I know this is nit-picky but I'm trying to understand and process all this stuff.

Attached Images
File Type: gif NT_partial_keyword.png (18.8 KB, 70 views)
Last edited by geoMEAN; 04-19-2008 at 04:46 AM. Reason: typo
geoMEAN is offline  
Reply With Quote
Old 04-19-2008, 04:23 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> If You = NT Staff, stop reading
Done
NinjaTrader_Dierk is offline  
Reply With Quote
Old 04-19-2008, 05:14 PM   #3
geoMEAN
Member
 
Join Date: Mar 2008
Posts: 69
Thanks: 0
Thanked 0 times in 0 posts
Question

Dierk, well at least you follow instructions!

Perhaps I'll elicit a quick response from a programmer if I refrase in shorter language:

Can the same namespace be defined across multiple .cs files?

E.g.:
//in file SMA.cs
namespace NinjaTrader.Indicator
{
public class SMA : Indicator
{
}
}
//in file EMA.cs
namespace NinjaTrader.Indicator
{
public class EMA : Indicator
{
}
}

I imagine this is what is happening each time I create a new indicator as I've heard that all strats are kept in 1 compiled strat file and all indicators kept in 1 compiled indicator file.
geoMEAN is offline  
Reply With Quote
Old 04-19-2008, 11:23 PM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> Can the same namespace be defined across multiple .cs files?
That's how all NS files work.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-17-2010, 08:10 AM   #5
TakisTakis
Member
 
Join Date: Jun 2010
Posts: 49
Thanks: 0
Thanked 0 times in 0 posts
Default

Quote:
Originally Posted by geoMEAN View Post

I imagine this is what is happening each time I create a new indicator as I've heard that all strats are kept in 1 compiled strat file and all indicators kept in 1 compiled indicator file.
This explains why if we mess up one strategy, no other strategy works until we fix the one that has the issue. Or why if we forget a reference in one file and take away the dll and then the strat that used it, we still have errors in other strats until the reference is GLOBALLY removed... I think...
Last edited by TakisTakis; 07-17-2010 at 08:13 AM.
TakisTakis 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
Why NTMarketPosition doesn't work? alekstraj Automated Trading 29 05-25-2011 06:11 AM
Functions from System.Drawing namespace JangoFolly Indicator Development 3 04-15-2008 02:03 PM
6.5.0.8 and MBT doesn't work woodside Historical NinjaTrader 6.5 Beta Threads 29 02-08-2008 04:48 AM
So does Gtc work in backtest? henry.omd Historical NinjaTrader 6.5 Beta Threads 10 12-30-2007 04:24 PM
"The namespace Ninjatrader.Indicator already contains a definition for '<indicator>'" eeisen Strategy Development 3 09-02-2007 09:47 PM


All times are GMT -6. The time now is 02:28 AM.