Strange Indicator Behavior: Newbie Question/Help! - futures io
futures io

Strange Indicator Behavior: Newbie Question/Help!

Discussion in NinjaTrader

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

Strange Indicator Behavior: Newbie Question/Help!

(login for full post details)
  #1 (permalink)
Bothell, WA
Experience: Intermediate
Platform: NinjaTrader
Trading: ES
Posts: 9 since Sep 2011
Thanks: 2 given, 2 received

With the help of some prior works of art, I created an indicator which changes the background color for a bar when the volume of that bar is above a minimum threshold and it is also greater than a certain percentage of the prior bars volume.

The problem, I'm having is that the indicator seems to work fine when I'm using the "CME US Index Futures ETH" Session template... but when I'm using the "CME US Index Futures RTH" Session template, the indicator does not plot anything....

From my troubleshooting, it appears that as soon as I include the the reference to Volume[1] (which should be the prior bars volume, according to the NinjaTrader help manual) then the indicator will not plot on the RTH session template. If I remove this reference and just have the indicator plot if the CURRENT bars volume is higher than a threshold (disregarding the prior bars volume) then it works on BOTH the RTH and ETH session templates.

I find this very strange and I'm sure I'm just not doing something basic! Any help would be greatly appreciated.

Here is a screenshot of the code as well as showing the indicator working on the top right ETH session template chart and NOT working on the bottom right RTH session template chart:

2013-03-14_0549 - ToddPMan's library

Thanks so much!


Started this thread Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(322 thanks from 32 posts)
looks_twoSalao's Journalby Salao
(81 thanks from 13 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(51 thanks from 21 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(42 thanks from 17 posts)
looks_5Maybe a little bit different journalby Malykubo
(23 thanks from 19 posts)
Best Threads (Most Thanked)
in the last 7 days on futures io
The Crude Dude Oil Trading System
114 thanks
Help improve the FIO community
38 thanks
Big Mike in Ecuador
22 thanks
futures io site changelog and issues/problem reporting
20 thanks
Next New Poll Ideas/Suggestions
20 thanks
(login for full post details)
  #3 (permalink)
 Fat Tails 
Market Wizard
Berlin, Europe
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Fat Tails's Avatar
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,744 received


You cannot reference the prior bar, when CurrentBar == 0. With the ETH session you were just lucky that the first bar usually is a low volume bar, such that lines 61 and 76 of your code were never executed.

All you need to do is to add the following lines of code in the beginning of OnBarUpdate():

if(CurrentBar == 0)

Reply With Quote
The following 2 users say Thank You to Fat Tails for this post:

futures io Trading Community Platforms and Indicators NinjaTrader > Strange Indicator Behavior: Newbie Question/Help!

Last Updated on March 14, 2013

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Journal Challenge w/$1,800 in prizes!


An Introduction to CME Group Micro Bitcoin Futures w/David Lerman

Elite only

Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, 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.
no new posts