NexusFi: Find Your Edge


Home Menu

 





Null Plots


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one kenz987 with 4 posts (3 thanks)
    2. looks_two Big Mike with 2 posts (1 thanks)
    3. looks_3 zeller4 with 1 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,788 views
    2. thumb_up 4 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

Null Plots

  #1 (permalink)
kenz987
Houston, TX
 
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5

In some indicators there are null plots.
if(x)
Plot0.Set
else
Plot1.Set
...
If you call that indicator from a strategy, how do you tell if a plot is null, since it is assigned to a double?
Thanks, Ken.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
My NT8 Volume Profile Split by Asian/Euro/Open
NinjaTrader
Ninja Mobile Trader VPS (ninjamobiletrader.com)
Trading Reviews and Vendors
Build trailing stop for micro index(s)
Psychology and Money Management
 
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,401 since Jun 2009
Thanks Given: 33,179
Thanks Received: 101,542


It will vary depending on the code. It would be best to post a fully functional example.

Is this a commercial closed-source system? If so, you might have to just some more complex stuff for determining which plots to pay attention to. Sometimes unwanted plots will return 0 or will return the Close price.

I had worked with a closed-source system before that returned Close price for example on any plots it wasn't using at the time.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #4 (permalink)
kenz987
Houston, TX
 
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5

Thanks Mike,
It is more a theoretical question, since I have the source code and can program around it, but seems there should be a way to check for nulls, since in database programming (and in excel) it is necessary. Ken.
ps: It does return some value, perhaps the close, I didn't check it.

Reply With Quote
  #5 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,401 since Jun 2009
Thanks Given: 33,179
Thanks Received: 101,542


kenz987 View Post
Thanks Mike,
It is more a theoretical question, since I have the source code and can program around it, but seems there should be a way to check for nulls, since in database programming (and in excel) it is necessary. Ken.
ps: It does return some value, perhaps the close, I didn't check it.

If you have the original indicator code, just use a Signal dataseries.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
kenz987
Houston, TX
 
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5

Well, I was just browsing around help and ran into this on the DataSeries Class help page:
//Checking for Valid Values
//It is possible that you may use a DataSeries object but decide not to set a value for a specific bar.
//Internally, a dummy value does exist which is the current bar close however,
//if you wanted to check to see if it was a valid value that you set, you can check the following method.
// test this for null values
// DataSeries.ContainsValue(int barsAgo)
//Returns a true or false value.
Also found something else interesting:
The Plot0.ContainsValue( index is intBarsAgo), so is the .Set
but the .Get is (index) or CurrentBar (may be CurrentBar plus or minus 1 - I'm not sure on this) but the inconsistency just floored me! Took me a while of frustration to realize what happened.
Hope this info is of some help to other coders. Ken.




Reply With Quote
Thanked by:
  #7 (permalink)
 zeller4 
Orlando Florida
 
Experience: Intermediate
Platform: NT8
Trading: CL, NQ, ES, RTY
Posts: 477 since Jun 2009
Thanks Given: 1,416
Thanks Received: 404

Thanks Ken,

I'm trying to advance my coding education and it's little things like this that could help turn the corner for the next big thing.

If you or anyone would care to use these few lines in an actual code to show their usage and results, it would be greatly appreciated!

Kirk

Reply With Quote
  #8 (permalink)
kenz987
Houston, TX
 
Posts: 23 since Apr 2010
Thanks Given: 17
Thanks Received: 5

Hi Kirk,
I don't have specific code handy, but here is something similar to what I was doing:
Say you have an indicator and the trend is shown by a Plot0 blue for an uptrend, and a Plot1 red for a downtrend, and you watch those values for a trend change. Similar to an EMA, but these come in two different plots.
if(Plot0.ContainsValue(0)) // true then not null
{
double dX = Plot0.Get(CurrentBar) // gotcha
}
// etc, (for compute on close)
I know you might not use Get that way unless you want the value of an offset way back (in my test case I only had values at the turns, not every bar).
Still learning this myself.
Ken.
ps: I forgot to say, I was calling the indicator from a strategy.

Reply With Quote
Thanked by:




Last Updated on May 10, 2010


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts