NT Quirks for beginners - NinjaTrader Programming | futures io social day trading
futures io futures trading


NT Quirks for beginners
Updated: Views / Replies:1,255 / 7
Created: by Peter Attachments:0

Welcome to futures io.

(If you already have an account, login at the top of the page)

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community.  It's free and simple.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

NT Quirks for beginners

  #1 (permalink)
Elite Member
Brisbane; Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: IB/TDA needing new broker
Favorite Futures: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 101 received

NT Quirks for beginners

I get often frustrated by undocumented NT quirks which cause(d) me to waste a lot of time trying to find solutions.
Solutions which are often known to the more experienced coders, who are thus pestered for the same answers time and time again. So I'll you this thread to list issues and solutions I encounter(ed).

Thanks to all who helped me to the right solutions/answers.
I hope you will not be offended if I won't mention those who provided the answers.
From some issues I even honestly don't know it anymore.

It is just a friendly help from one code amateur to the next beginner.


Last edited by Peter; June 12th, 2009 at 08:08 AM.
Reply With Quote
The following user says Thank You to Peter for this post:
 
  #2 (permalink)
Elite Member
Brisbane; Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: IB/TDA needing new broker
Favorite Futures: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 101 received

Wizard refuses to compile wizard strategy

Apparently the NT strategy wizard has a bug that doesn't like those fancy MA selectors some of the coders here made.

Solution:
Open the code and use search and replace to change:
'NinjaTrader.Indicator.MAV+MAType' into 'NinjaTrader.Indicator.MAV.MAType' (the '+' should be a '.')


Last edited by Peter; June 13th, 2009 at 05:28 AM.
Reply With Quote
The following user says Thank You to Peter for this post:
 
  #3 (permalink)
Site Administrator
Manta, Ecuador
 
Futures Experience: Advanced
Platform: My own custom solution
Favorite Futures: E-mini ES S&P 500
 
Big Mike's Avatar
 
Posts: 46,240 since Jun 2009
Thanks: 29,351 given, 83,223 received


Nice topic, Peter.

I can think of a bunch of things to add to this thread, as they come up I will do so.

One thing that isn't entirely a quirk but still an issue/important is to always view your Log tab if you are having any "weird" stuff go on. I can't tell you how many times I was backtesting strategies for hours and getting odd results, only to look at my Log tab and find a slew of OutOfMemory.Exception errors. Ninja had kept quiet about them except for the log.

The log tab is very handy for a variety of other things too when writing new code.

Mike

Reply With Quote
 
  #4 (permalink)
Elite Member
Brisbane; Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: IB/TDA needing new broker
Favorite Futures: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 101 received

I can't select Open, Close, High, etc.

Solution: Open the indicator (toools -> edit -> indicator) and look for the line
'PriceTypeSupported' =false'.
Change 'false' to 'true' and recompile.
Tht is all ... you should now have the choice when using the indicator.

BTW It is always wise to make a backup before editing such stuff.

Reply With Quote
 
  #5 (permalink)
Elite Member
Neubrandenburg, Germany
 
Futures Experience: Advanced
Platform: R
Favorite Futures: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 297 given, 480 received


Peter View Post
Apparently NT has a bug that doesn't like those fancy MA selectors some of the coders here made.

Solution:
Open the code and use search and replace to change:
'NinjaTrader.Indicator.MAV+MAType' into 'NinjaTrader.Indicator.MAV.MAType' (the '+' should be a '.')

The dot is for basic C # and Ninja Script Object oriented work (Objects).
The plus stands for a concatenation of strings and numbers (variables).

Quick Example is
double what = Namespace.Indicator.Method.DoubleVariable + Namespace.Enum.MaType.EMA(Close[0])

Reply With Quote
The following user says Thank You to wh for this post:
 
  #6 (permalink)
Elite Member
Brisbane; Australia
 
Futures Experience: Intermediate
Platform: NT
Broker/Data: IB/TDA needing new broker
Favorite Futures: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 101 received

Long and short alway in separate strategy

I never use long and short in the same strategy anymore.
I separated all my previous strategies with combined long/short strategies into one strategy for long and a separate strategy for short.
There are potential issues that did cost me !!

Three reasons:
1 - It is easier and faster to run optimizations.

2 - Sometimes your broker might not have shares to short and rejects the order. NT will then stop the strategy.
If you have long and short separated .... at least the long strategy will keep working.

3 - Potential 'overfills'
Assume you are long in a combined long/short strategie. To get out of the long you have both an 'EnterShort' rule and an 'ExitShort' rule with different parameters.
The 'ExitShort' is in the strategy to exit the strategy long position before the circumstances were met to enter a short.
I found that at times the (speed of the) price development triggered both rules in the same bar, triggering both ExitLong and EnterShort at the same time...... the effect was that NT puts me in a double short position.

I had 'entries per direction=1' and 'statements to check for Position.Long or Short' in my strategy but they were not able to prevent overfills.
Also this issue does not show up in backtesting or optimizing.

The internal order handling rules in NT should prevent your strategy to enter a second position short (if you set entries per direction =1), but apparently this does not always work. After some Emails NT told me:

"Overfills are always a possibility. The Internal Order Handling Rules are in place to reduce the overfill scenarios, but it does not 100% remove them (emphasis added). Also, since you are using market orders, the rules do not apply. You should become familiar with these risks as they generally govern things like overfills. "

I was aware of the text at the link above in the manual, but as NT beginner I apparently did not yet fully appreciate certain texts in the manual.
For more details see here

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Garner, NC/USA
 
Futures Experience: Advanced
Platform: Ninja Trader, thinkorswim
Broker/Data: thinkorswim, MBTrading
Favorite Futures: TF
 
Posts: 29 since Dec 2009
Thanks: 16 given, 33 received

If you want to use "PriceTypeSupported, remember to change any reference to a price point (OHLC) to "Input".

For example: "SMA(Close, 10)" should be changed to "SMA(Input, 10)".



Peter View Post
Solution: Open the indicator (toools -> edit -> indicator) and look for the line
'PriceTypeSupported' =false'.
Change 'false' to 'true' and recompile.
Tht is all ... you should now have the choice when using the indicator.

BTW It is always wise to make a backup before editing such stuff.


Reply With Quote
 
  #8 (permalink)
Member
California
 
Futures Experience: Beginner
Platform: NinjaTrader
 
Posts: 87 since Jun 2009
Thanks: 5 given, 119 received

here's one:

if you're optimizing, you might want to keep a reference to your indicators in your strategies instead of having to search the indicator cache every time.

For example, instead of doing
 
Code
                            
protected override void Initialize() 

{
    
Add (EMA (Input20));
}

protected 
override void OnBarUpdate () 
{
    
double someValue EMA (Input20) [0];

you can do this:
 
Code
                            
EMA _ema;


protected 
override void Initialize() 
{
    
Add (_ema EMA (Input20));
}

protected 
override void OnBarUpdate () 
{
    
double someValue _ema [0];


Reply With Quote
The following user says Thank You to piersh for this post:

Reply



futures io > > > > > NT Quirks for beginners

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Good trading books for beginners aj7harrison Trading Journals 2 March 4th, 2011 09:38 AM
Webinar "Trading discipline and psychology for beginners" adorati Psychology and Money Management 15 October 24th, 2010 01:04 PM
Workspace choices for beginners Gavroche Beginners and Introductions 4 March 28th, 2010 12:19 AM
NT 6.5 issue - image sometimes stays on screen after I close NT window Todd The Elite Circle 11 March 19th, 2010 10:14 AM
coding for beginners : Text + Value-Boxes in your chart max-td NinjaTrader Programming 5 January 14th, 2010 07:56 AM


All times are GMT -4. The time now is 05:01 PM.

Copyright © 2017 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts
Page generated 2017-12-13 in 0.13 seconds with 19 queries on phoenix via your IP 54.90.92.204