NexusFi: Find Your Edge


Home Menu

 





Indicator programming


Discussion in NinjaTrader

Updated
    1. trending_up 3,510 views
    2. thumb_up 2 thanks given
    3. group 3 followers
    1. forum 3 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

Hi there,
I recently observed a problem related to calculation of indicators by values of another indicator.
For illustration see the following example:

indi1:

if (CurrentBar>=200)
{
Plot0.Set(1);
}
else
{return;}

Applied to a chart the indicator plots nothing before bar no. 200, after it it plots 1.

indi2:

Plot0.Set(Testindi1()[0]);

I would expect and want indi2 to do the same as indi1, which means to plot and calculate nothing befor bar number 200.
What happens instead is that the value of the current Close is plotted befor bar number 200.

Any suggestions how to get rid of/suppress that behaviour?


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Rubios Good News Within Hours and the 30-Day Math: Why H …
Prediction Markets & Event Contracts
CME Lists U.S. Election Event Contracts as 2028 Democrat …
Prediction Markets & Event Contracts
MegaETH Proves the Crowd Right: Prediction Markets Calle …
Prediction Markets & Event Contracts
Energy Futures Shatter All-Time Daily Volume: 8.3 Millio …
Commodities
Iran Airspace Collapses 18 Points to 15.5% While Hormuz …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
21 thanks
2026 Jlab journal
10 thanks
Trying to learn Volume and price action correlation
8 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Hello Im new here
5 thanks
  #3 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 278 since Jun 2009
Thanks Given: 161
Thanks Received: 271


i suppose u do a checking like

 
Code
if (Testindi1().Value.IsValidPlot(CurrentBar))
{
//do your stuff
}


Reply With Quote
Thanked by:
  #4 (permalink)
Mondrakete
Germany
 
Posts: 24 since Feb 2011
Thanks Given: 1
Thanks Received: 0

-Thanks, with that checking it works.


Reply With Quote




Last Updated on April 3, 2011


© 2026 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 - Downloads - Top
no new posts