NexusFi: Find Your Edge


Home Menu

 





display index number above candle


Discussion in NinjaTrader

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




 
Search this Thread
  #1 (permalink)
lakersfan
Los Angeles, CA
 
Posts: 5 since Apr 2020
Thanks Given: 1
Thanks Received: 0

Hi, i'm coding for ninjatrader 7, and want to know how to put the index number above the candle.

So far, i've got

int index = Count - CurrentBar;
DrawText("tag"+CurrentBar.ToString(), true, index.ToString(), 0, High[0], 30, Color.Orange, hFont, StringAlignment.Center, Color.Transparent, Color.Transparent, 0);


This works when I place the indicator, but then keeps printing "0" to each candle as if that was the index number. It looks as though the indicator only works when initializing.


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
White House Drops First Alien Files Today -- Market Says …
Prediction Markets & Event Contracts
NinjaTrader Parent Payward Acquires Bitnomial for $550M …
Platforms and Indicators
Prediction Markets Lock Fed Pause at 99pct for April 29 …
Prediction Markets & Event Contracts
May 26 Deadline Dies at 7.5% as US Strikes Iran During C …
Prediction Markets & Event Contracts
$24.5 Billion Record Month: Prediction Markets Shatter A …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #2 (permalink)
 asfax 
Prague, Czech Republic
 
Experience: Advanced
Platform: NinjaTrader
Broker: Interactive Brokers
Trading: NQ
Posts: 57 since Sep 2009
Thanks Given: 34
Thanks Received: 79

Hi @lakersfan,
in my opinion, it is not a good idea to use DrawText() to index bars for performance reasons. Try attached indicator instead...


Attached Files
Elite Membership required to download: asfBarIndex.zip
Reply With Quote
Thanked by:




Last Updated on April 27, 2020


© 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