How to Color a Single Bar in NT7? - futures io
futures io futures trading



How to Color a Single Bar in NT7?


Discussion in NinjaTrader

Updated by aligator
      Top Posters
    1. looks_one aligator with 4 posts (2 thanks)
    2. looks_two Silvester17 with 3 posts (4 thanks)
    3. looks_3 RJay with 2 posts (2 thanks)
    4. looks_4 Silver Dragon with 2 posts (5 thanks)
      Best Posters
    1. looks_one Silver Dragon with 2.5 thanks per post
    2. looks_two Silvester17 with 1.3 thanks per post
    3. looks_3 RJay with 1.0 thanks per post
    4. looks_4 aligator with 0.5 thanks per post
    1. trending_up 6,880 views
    2. thumb_up 13 thanks given
    3. group 2 followers
    1. forum 10 replies
    2. attach_file 7 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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)

 
Thread Tools Search this Thread
 

How to Color a Single Bar in NT7?

  #1 (permalink)
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,423 since Aug 2010
Thanks: 1,057 given, 5,836 received

How to Color a Single Bar in NT7?

How to Color a Single Bar in NT7. I would like to color a single bar using BarColor similar to drawing arrows. But when I use the following:

BarColor = Color.Chartreuse;
CandleOutlineColor = Color.Chartreuse;

after my conditions all bars are painted the same. How do I limit painting only to a single bar? I like to paint the bar instead of using arrows or other objects.

Thanks.

Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to aligator for this post:

Can you help answer these questions
from other members on futures io?
Convert NinjaTrader NT7 indicator to Tradestation EasyLanguage and RADARSCREEN
Platforms and Indicators
Issue meeting order entry conditions
Elite Automated NinjaTrader Trading
Last 5 minutes Label
ThinkOrSwim
Moving average with Lag reduction
NinjaTrader
Linux?
ThinkOrSwim
 
Best Threads (Most Thanked)
in the last 7 days on futures io
Spoo-nalysis ES e-mini futures S&P 500
259 thanks
Want your NinjaTrader indicator created, free?
50 thanks
VWAP for stock index futures trading?
39 thanks
Is Amp at risk of going under?
37 thanks
What is your single biggest weakness?
36 thanks
 
  #2 (permalink)
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 685 since Jun 2009
Thanks: 743 given, 769 received


aligator View Post
How to Color a Single Bar in NT7. I would like to color a single bar using BarColor similar to drawing arrows. But when I use the following:

BarColor = Color.Chartreuse;
CandleOutlineColor = Color.Chartreuse;

after my conditions all bars are painted the same. How do I limit painting only to a single bar? I like to paint the bar instead of using arrows or other objects.

Thanks.

Try this. (Copied from Help area inside NT)


Property Value
A color series type object. Accessing this property via an index value [int barsAgo] returns a color structure representing the referenced bar's color.


Syntax
BarColorSeries
BarColorSeries[int barsAgo]


Examples


// Sets the color of the current bar to blue.

BarColorSeries[0] = Color.Blue;



// Sets the color of the previous bar to orange.


BarColorSeries[1] = Color.Orange;


RJay

Reply With Quote
The following user says Thank You to RJay for this post:
 
  #3 (permalink)
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,423 since Aug 2010
Thanks: 1,057 given, 5,836 received


Thanks a bunch @RJay for your prompt response. I used the following:

BarColorSeries[0] = Color.Blue;

No luck, and I got all the bars in Blue. I must be missing something. Perhaps I can use an existing indicator as an example. Do you know of a similar indicator on futures.io (formerly BMT)?

Thanks again.

Visit my futures io Trade Journal Reply With Quote
 
  #4 (permalink)
Legendary Market Wizard
Columbus, OH
 
Experience: None
Platform: NT 8, TOS
Trading: ES
 
Silvester17's Avatar
 
Posts: 3,535 since Aug 2009
Thanks: 4,985 given, 11,209 received


aligator View Post
How to Color a Single Bar in NT7. I would like to color a single bar using BarColor similar to drawing arrows. But when I use the following:

BarColor = Color.Chartreuse;
CandleOutlineColor = Color.Chartreuse;

after my conditions all bars are painted the same. How do I limit painting only to a single bar? I like to paint the bar instead of using arrows or other objects.

Thanks.

@aligator

maybe this will help.

I just used the cci as an example. if cci > 0, only the first bar will be colored. the same if cci < 0, only the first bar will be colored.

attached the example indicator for reference.

please keep in mind, there might be better solutions. guess I don't need to tell you, because your programming knowledge is far more superior than mine.


Attached Files
Register to download File Type: cs CCIwithSingleBarColor.cs (8.7 KB, 76 views)

Last edited by Silvester17; January 7th, 2012 at 01:03 AM.
Reply With Quote
The following 3 users say Thank You to Silvester17 for this post:
 
  #5 (permalink)
Cincinnati Ohio
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Futures Broker
Trading: FX, Stocks, Options
 
Silver Dragon's Avatar
 
Posts: 1,783 since Feb 2011
Thanks: 5,045 given, 4,100 received


aligator View Post
How to Color a Single Bar in NT7. I would like to color a single bar using BarColor similar to drawing arrows. But when I use the following:

BarColor = Color.Chartreuse;
CandleOutlineColor = Color.Chartreuse;

after my conditions all bars are painted the same. How do I limit painting only to a single bar? I like to paint the bar instead of using arrows or other objects.

Thanks.

See attached example. This should get you what you want.
Note: Calulate on Bar close needs to be set to false.

 
Code

if (CurrentBar == Count -1)
{
BarColor = Color.Black;
}

nosce te ipsum

You make your own opportunities in life.
Attached Files
Register to download File Type: cs TestColorBar.cs (6.5 KB, 32 views)
Visit my futures io Trade Journal Reply With Quote
The following user says Thank You to Silver Dragon for this post:
 
  #6 (permalink)
Cincinnati Ohio
 
Experience: Intermediate
Platform: NinjaTrader
Broker: Futures Broker
Trading: FX, Stocks, Options
 
Silver Dragon's Avatar
 
Posts: 1,783 since Feb 2011
Thanks: 5,045 given, 4,100 received

If you wanted to do the current bar and 8 bars back do this:


 
Code

//Current Bar
if (CurrentBar == Count -1)
{
BarColor = Color.Black;
}
 
// 8 bars back
 
if (CurrentBar == Count -8)
{
BarColor = Color.Blue;
}

nosce te ipsum

You make your own opportunities in life.
Visit my futures io Trade Journal Reply With Quote
The following 4 users say Thank You to Silver Dragon for this post:
 
  #7 (permalink)
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
 
RJay's Avatar
 
Posts: 685 since Jun 2009
Thanks: 743 given, 769 received


aligator View Post
Thanks a bunch @RJay for your prompt response. I used the following:

BarColorSeries[0] = Color.Blue;

No luck, and I got all the bars in Blue. I must be missing something. Perhaps I can use an existing indicator as an example. Do you know of a similar indicator on futures.io (formerly BMT)?

Thanks again.

Just need to specify which bar(s) to color with some specific criteria.

Ex.

if(High[1]>=High[2])if(High[1]>=High[0])BarColorSeries[0] = Color.Orange;

Reply With Quote
The following user says Thank You to RJay for this post:
 
  #8 (permalink)
Site Administrator
Manta, Ecuador
 
Experience: Advanced
Platform: My own custom solution
Trading: Emini Futures
 
Big Mike's Avatar
 
Posts: 48,724 since Jun 2009
Thanks: 31,458 given, 93,981 received

 
Thread Moved


Moved from NinjaTrader
Moved to NinjaTrader Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading


We're here to help -- just ask

For the best trading education, watch our webinars
Searching for trading reviews? Review this list

Follow us on Twitter, YouTube, and Facebook

Support our community as an Elite Member:
https://futures.io/elite/
Follow me on Twitter Visit my Facebook Visit my futures io Trade Journal Reply With Quote
 
  #9 (permalink)
Las Vegas, NV
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65, Metastock, TOS, NT
Trading: Futures
 
aligator's Avatar
 
Posts: 3,423 since Aug 2010
Thanks: 1,057 given, 5,836 received

Thanks a million Ticks

Gentle People:

@RJay, @Silvester17, and @Silver Dragon, you guys are awesome! Thank you.

Visit my futures io Trade Journal Reply With Quote
 
  #10 (permalink)
Legendary Market Wizard
Columbus, OH
 
Experience: None
Platform: NT 8, TOS
Trading: ES
 
Silvester17's Avatar
 
Posts: 3,535 since Aug 2009
Thanks: 4,985 given, 11,209 received



Silvester17 View Post
@aligator

maybe this will help.

I just used the cci as an example. if cci > 0, only the first bar will be colored. the same if cci < 0, only the first bar will be colored.

attached the example indicator for reference.

please keep in mind, there might be better solutions. guess I don't need to tell you, because your programming knowledge is far more superior than mine.

another way of course would be to use the "CrossAbove and CrossBelow" function. that also should only color the trigger bar as well.

used the same example as before and attached the indicator for reference.

Attached Files
Register to download File Type: cs CCIwithSingleBarColor.cs (8.5 KB, 39 views)
Reply With Quote
The following user says Thank You to Silvester17 for this post:



futures io Trading Community Platforms and Indicators NinjaTrader > How to Color a Single Bar in NT7?




Upcoming Webinars and Events
 

Understanding Order Flow Stops Runs & Icebergs w/Bookmap

May 28
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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