No results in NT indicator if "close[>1]" close larger than [1] - futures io
futures io futures trading



No results in NT indicator if "close[>1]" close larger than [1]


Discussion in NinjaTrader

Updated
    1. trending_up 844 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 3 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
 

No results in NT indicator if "close[>1]" close larger than [1]

(login for full post details)
  #1 (permalink)
Leipzig
 
 
Posts: 2 since Feb 2014
Thanks: 0 given, 0 received

I want to write an indicator (EOD base used) with the following content:

if (Close[0] < Close[5]
&& Close[0] > SMA(50)[0])

Plot0.Set(1);

My problem is the "close[5]". I get permanent no result. If I change the "close[5]" into "close[1]" can I see correct results. I think anywhere is a problem with the loaded day data. Anybody out there who knows a solution?

Thanks Mike

Reply With Quote

Journal Challenge February 2021 results:
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(173 thanks from 31 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(120 thanks from 33 posts)
looks_3Wisdom is Emptinessby Mtype
(68 thanks from 25 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(35 thanks from 17 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (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,764 since Jun 2009
Thanks: 32,302 given, 97,536 received


hallou1 View Post
I want to write an indicator (EOD base used) with the following content:

if (Close[0] < Close[5]
&& Close[0] > SMA(50)[0])

Plot0.Set(1);

My problem is the "close[5]". I get permanent no result. If I change the "close[5]" into "close[1]" can I see correct results. I think anywhere is a problem with the loaded day data. Anybody out there who knows a solution?

Thanks Mike

Most likely you are missing something like:

if (CurrentBar < 5) return;

at the top of your OnBarUpdate.

This would be more obvious if you examined the log error tab.

Mike

We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Big Mike for this post:
 
(login for full post details)
  #3 (permalink)
Portland Oregon, United States
 
Experience: Beginner
Platform: Ninjatrader®
Broker: CQG, Kinetick
Trading: Gameplay Klownbine® Trading of Globex
 
Zondor's Avatar
 
Posts: 1,347 since Jul 2009
Thanks: 1,245 given, 2,721 received


With current bar <5 you would have been getting an Index Out of Range error that would have crashed the indicator since for those bars, Close[5] does not exist. That's why rejecting bars prior to bar number 5 fixed the problem.

"If we don't loosen up some money, this sucker is going down." -GW Bush, 2008
“Lack of proof that something is true does not prove that it is not true - when you want to believe.” -Humpty Dumpty, 2014
“The greatest shortcoming of the human race is our inability to understand the exponential function.”
Prof. Albert Bartlett
Follow me on Twitter Visit my futures io Trade Journal Reply With Quote
 
(login for full post details)
  #4 (permalink)
Leipzig
 
 
Posts: 2 since Feb 2014
Thanks: 0 given, 0 received


Big Mike View Post
Most likely you are missing something like:

if (CurrentBar < 5) return;

at the top of your OnBarUpdate.

This would be more obvious if you examined the log error tab.

Mike

Hallo Big Mike,

thanks for your quick reply. I wrote a short code that display me the closeprice 5 days ago. The result was correct. Tomorrow will I update my screencode and test. One last question: Where can I open the "log error tab"?

Good evening from Germany

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > No results in NT indicator if "close[>1]" close larger than [1]


Last Updated on February 3, 2014


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

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

March
 

Call Option Buying: The New Pain Trade? w/Carley Garner

Elite only
 

Importance of Finding Your Own Way w/Adam Grimes

Elite only
 

New Challenge (TBD)

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