NexusFi: Find Your Edge


Home Menu

 





Indicator programming


Discussion in NinjaTrader

Updated
    1. trending_up 3,669 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?
Datafeed for Atas
Platforms and Indicators
Warsh Drops Easing Bias, December Hike Now Above 50% -- …
Prediction Markets & Event Contracts
Without Pulisic, USA 61.5% Live vs. Australia -- France …
Prediction Markets & Event Contracts
Would a node-based workflow for automated trading be useful?
Traders Hideout
Daytrading to swingtrading
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
BERN ALGOS algo trading journal
1 thanks
Afternoon-close session
1 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
  #3 (permalink)
 bukkan 
Calcutta, India
 
Experience: Intermediate
Platform: ArthaChitra
Posts: 279 since Jun 2009
Thanks Given: 161
Thanks Received: 272


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