NexusFi: Find Your Edge


Home Menu

 





display index number above candle


Discussion in NinjaTrader

Updated
    1. trending_up 1,510 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?
GANN THEORY DAVID BOWDEN SAFETY IN THE MARKETS
Traders Hideout
GFIs1 DAX System
Traders Hideout
New York Stock Exchange to Launch NYSE Texas
Stocks and ETFs
Feb & Mar24 New Ag Micros & New Solana Crypto Fu …
Traders Hideout
Jigsaw Lifetime License for sale!
Platforms and Indicators
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Tariffs and what comes next...
6 thanks
Lady Vols Primer: Trading Volatility Journal
4 thanks
Ghost Journal
1 thanks
Converting NT7 indicators to NT8 for free
1 thanks
2025 SNAKE
1 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


© 2025 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