NinjaTrader Support Forum  
X

Attention!

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


Go Back   NinjaTrader Support Forum > Suggestions and Feedback > Suggestions And Feedback

Suggestions And Feedback New feature suggestions and feedback.

Reply
 
Thread Tools Display Modes
Old 04-25-2009, 09:45 PM   #1
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default programming of very basic indicators

Besides the PDF and the Reference Samples at the forum,
there are no other examples, correct?
stephenszpak is offline  
Reply With Quote
Old 04-25-2009, 10:18 PM   #2
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

No, there are lots of examples on this forum. I would start with the reference samples.
NinjaTrader_Ben is offline  
Reply With Quote
Old 04-25-2009, 10:22 PM   #3
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Ok, is it reasonable to search for an example that
will draw and up arrow when a TRIX(50,5) crosses?
I will give it a shot if you think I can find something
within 20 minutes. Else it seems like searching for a
needle in a haystack. I'm not looking for a program
that will do 100 things including the above. It's hard
enough already.
stephenszpak is offline  
Reply With Quote
Old 04-26-2009, 12:46 AM   #4
stephenszpak
Senior Member
 
Join Date: Apr 2006
Location: , ,
Posts: 192
Thanks: 3
Thanked 0 times in 0 posts
Default

Ok, finally I seem to be getting there. But I still think
that a hundred or so very basic ninjascript examples
for indicators would be a good idea. Telling people to
have a programmer do it means, essentially, that the
cost of NT software has a number of hidden fees. Each
indicator being that $XXX fee.
stephenszpak is offline  
Reply With Quote
Old 04-26-2009, 08:35 AM   #5
NinjaTrader_Ben
NinjaTrader Customer Service
 
NinjaTrader_Ben's Avatar
 
Join Date: May 2008
Location: Denver, CO
Posts: 3,157
Thanks: 0
Thanked 3 times in 3 posts
Default

Hello,

Yes, to use any programming language you will need to have some programming knowledge. Due to resource limitations the more complex or common confusion areas have examples in the reference samples area. I will pass your suggestion on to our development department for consideration though. Thank you!
NinjaTrader_Ben is offline  
Reply With Quote
Old 05-08-2009, 05:20 PM   #6
trader1512
Senior Member
 
Join Date: Feb 2009
Posts: 153
Thanks: 0
Thanked 0 times in 0 posts
Default programming indicators

i too am looking for a basic indicator.

when CCI crosses over -100(user input) draw an up arrow on the low of the previous bar and play a sound.

am able to do it in strategy but that takes my trades off the chart and they have to be reloaded each time i connect.

any suggestions on where to start or to give the code.

i can use the swing indicator as a starting point.

just dont see how to do a crossover like in the strategy
trader1512 is offline  
Reply With Quote
Old 05-08-2009, 05:31 PM   #7
trader1512
Senior Member
 
Join Date: Feb 2009
Posts: 153
Thanks: 0
Thanked 0 times in 0 posts
Default

figured out i can view the code from the strategy. now the question is can i copy pieces of that code or convert a strategy into an indicator
trader1512 is offline  
Reply With Quote
Old 05-09-2009, 06:46 AM   #8
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Thanks: 0
Thanked 2 times in 2 posts
Default

The best way to learn in the beginning is to view NinjaScript that you understand.

For instance, Tools -> Edit -> Indicator, and pick one you grasp the end result of, like SMA. Open it, don't change anything, and read it one line at a time.

C# is not some alien language. It is pretty straight forward english, to read and understand. The harder part is when you want to do something and you don't know the command and haven't found an example. Then you can google it and find it usually pretty instantly.

As for NT-specific functions, you'll find a hundred examples in the File Sharing section, plus the ones already included with the shipping version of NT.

If you want to know how to paint an arrow on the screen when a Cross happens, then you could for instance browse through the list of indicators in File Sharing section, look at the pictures, and find one that paints arrows on the screen. Then look at the code.

If all of this is too overwhelming, hire a programmer in the beginning and tell him up front to comment all the code so you can read it and learn from it later. You tell him in plain english what you want, you pay him for his expertise, and then you learn from the result.

Mike
ctrlbrk is offline  
Reply With Quote
Old 05-09-2009, 06:50 AM   #9
ctrlbrk
Senior Member
 
Join Date: Oct 2008
Location: Dallas, TX
Posts: 682
Thanks: 0
Thanked 2 times in 2 posts
Default

trader1512,

If you already have the working code in a Strategy, that code will most likely be very easy to put into an indicator instead.

I would suggest opening up the CCI indicator, then Save As and name the new one "CCI Mod" or "My CCI" or whatever so you only mess with a copy, leaving the original alone. In this case, CCI is built-in to Ninja, so you have to save a new copy to make changes regardless.

Then you'll see at the bottom of the page where it is setting the value (Value.Set). Underneath that is probably a good spot to put your code, which presumably is a if (CrossAbove()) and DrawUpArrow and PlaySound. It should all work fine.

If you still have problems, paste all relevant code to the forum and the errors, if any, so others can easily help you.

Mike
ctrlbrk is offline  
Reply With Quote
Old 05-10-2009, 08:28 AM   #10
trader1512
Senior Member
 
Join Date: Feb 2009
Posts: 153
Thanks: 0
Thanked 0 times in 0 posts
Default

thanks. can someone point me to the file sharing and pdf sections that is referenced on the forum. i have had no luck finding them.
trader1512 is offline  
Reply With Quote
Old 05-10-2009, 10:56 AM   #11
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,384
Thanks: 252
Thanked 967 times in 950 posts
Default

You can check the reference samples here - http://www.ninjatrader-support2.com/...splay.php?f=30

Our indicator coding tutorials can be found here - http://www.ninjatrader-support.com/H...verview18.html

The indicator file sharing section is located here - http://www.ninjatrader-support2.com/...splay.php?f=38

Our strategy wizard can also be a great and effective learning tool, as you can later choose to view and unlock the generated source code - http://www.ninjatrader-support.com/H...rdScreens.html
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-10-2009, 03:41 PM   #12
trader1512
Senior Member
 
Join Date: Feb 2009
Posts: 153
Thanks: 0
Thanked 0 times in 0 posts
Default

that is what i have been doing with the strategy wizard, the question is whether i can convert the strategy code into an indicator.
trader1512 is offline  
Reply With Quote
Old 05-10-2009, 08:11 PM   #13
NinjaTrader_RJ
NinjaTrader Customer Service
 
NinjaTrader_RJ's Avatar
 
Join Date: Jul 2008
Location: Denver, CO, USA
Posts: 1,828
Thanks: 4
Thanked 19 times in 18 posts
Default

Quote:
Originally Posted by trader1512 View Post
that is what i have been doing with the strategy wizard, the question is whether i can convert the strategy code into an indicator.
Hi trader1512,

If you have limited time or programming capabilities, you can discuss your requirements with any of our NinjaScript consultants.
Click here for a list of certified NinjaScript Consultants
NinjaTrader_RJ is offline  
Reply With Quote
Old 05-11-2009, 11:32 AM   #14
trader1512
Senior Member
 
Join Date: Feb 2009
Posts: 153
Thanks: 0
Thanked 0 times in 0 posts
Default

can you direct me on how to remove something from the namespace. when i compile i am getting an already exists message.

thansk
trader1512 is offline  
Reply With Quote
Old 05-11-2009, 11:44 AM   #15
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

trader1512,

Unfortunately we do not know which scripts may be conflicting with what in your install. It may be easiest if you cleared your NinjaScripts out to remove any potential conflicts.
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
Programming connections Gumphrie Connecting 6 12-11-2009 03:09 AM
Programming a Pullback 123r34 Strategy Development 3 02-19-2009 03:10 PM
Programming help kipper General Programming 3 12-14-2008 12:12 AM
Programming question sauer11155 General Programming 3 09-02-2008 11:34 AM
Basic programming question winJR General Programming 4 02-15-2008 04:12 PM


All times are GMT -6. The time now is 12:25 AM.