NT Quirks for beginners - futures io
futures io futures trading



NT Quirks for beginners


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Peter with 4 posts (2 thanks)
    2. looks_two piersh with 1 posts (1 thanks)
    3. looks_3 Big Mike with 1 posts (0 thanks)
    4. looks_4 wh with 1 posts (1 thanks)
    1. trending_up 2,516 views
    2. thumb_up 4 thanks given
    3. group 4 followers
    1. forum 7 posts
    2. attach_file 0 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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

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

 
Search this Thread
 

NT Quirks for beginners

(login for full post details)
  #1 (permalink)
Brisbane; Australia
 
Experience: Intermediate
Platform: NT
Broker: IB/TDA needing new broker
Trading: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 113 received

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.

Started this thread Reply With Quote
The following user says Thank You to Peter for this post:

Can you help answer these questions
from other members on futures io?
Automatic pattern research with NT
Elite Algorithmic NinjaTrader Trading
OFA (Order Flow Analytics) Licence
NinjaTrader
Automating strategies on multiple charts with same symbol
TradeStation
Indicators for pair trading MES and M2K
Platforms and Indicators
MACD line not plotting after change of plot order
NinjaTrader
 
 
(login for full post details)
  #2 (permalink)
Brisbane; Australia
 
Experience: Intermediate
Platform: NT
Broker: IB/TDA needing new broker
Trading: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 113 received

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 '.')

Started this thread Reply With Quote
The following user says Thank You to Peter for this post:
 
(login for full post details)
  #3 (permalink)
Site Administrator
Swing Trader
Data Scientist & DevOps
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 49,779 since Jun 2009
Thanks: 32,306 given, 97,566 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

Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
Brisbane; Australia
 
Experience: Intermediate
Platform: NT
Broker: IB/TDA needing new broker
Trading: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 113 received

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.

Started this thread Reply With Quote
 
(login for full post details)
  #5 (permalink)
Neubrandenburg, Germany
 
Experience: Advanced
Platform: R
Trading: Stocks
 
wh's Avatar
 
Posts: 538 since Jun 2009
Thanks: 298 given, 504 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:
 
(login for full post details)
  #6 (permalink)
Brisbane; Australia
 
Experience: Intermediate
Platform: NT
Broker: IB/TDA needing new broker
Trading: Futures, Forex, Stocks
 
Peter's Avatar
 
Posts: 97 since Jun 2009
Thanks: 91 given, 113 received

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

Started this thread Reply With Quote
 
(login for full post details)
  #7 (permalink)
Garner, NC/USA
 
 
Posts: 33 since Dec 2009
Thanks: 16 given, 37 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
 
(login for full post details)
  #8 (permalink)
California
 
 
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:


futures io Trading Community Platforms and Indicators NinjaTrader > NT Quirks for beginners


Last Updated on January 4, 2010


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

Journal Challenge w/Jigsaw

April
     



Copyright © 2021 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