NexusFi: Find Your Edge


Home Menu

 





display index number above candle


Discussion in NinjaTrader

Updated
    1. trending_up 1,823 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?
Netherlands & Germany Surge as World Cup Field Narro …
Prediction Markets & Event Contracts
Would a node-based workflow for automated trading be useful?
Traders Hideout
Czechia Live at 52.5% as England Rides 4-2 Wave to Co-Fa …
Prediction Markets & Event Contracts
Iran Lebanon Problem Kills Switzerland Talks, Brent at $ …
Prediction Markets & Event Contracts
Trump Media to sell instant access to market-moving soci …
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Want your NinjaTrader indicator created, free?
5 thanks
Franks Trading Journey
1 thanks
Denied 20K payouts: Alpha Futures
1 thanks
FootPrintV2 Chart for NT8
1 thanks
BERN ALGOS algo trading journal
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


© 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