NexusFi: Find Your Edge


Home Menu

 





How to Color a Single Bar in NT7?


Discussion in NinjaTrader

Updated
      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 thanks per post
    4. looks_4 aligator with 0.5 thanks per post
    1. trending_up 8,806 views
    2. thumb_up 13 thanks given
    3. group 2 followers
    1. forum 10 posts
    2. attach_file 7 attachments




 
Search this Thread

How to Color a Single Bar in NT7?

  #1 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,620 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,992

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 NexusFi Trade Journal Started this thread Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
REcommedations for programming help
Sierra Chart
Trade idea based off three indicators.
Traders Hideout
MC PL editor upgrade
MultiCharts
How to apply profiles
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Spoo-nalysis ES e-mini futures S&P 500
29 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
24 thanks
Bigger Wins or Fewer Losses?
23 thanks
GFIs1 1 DAX trade per day journal
17 thanks
  #2 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 758
Thanks Received: 787


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
Thanked by:
  #3 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,620 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,992


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 NexusFi Trade Journal Started this thread Reply With Quote
  #4 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527


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
Elite Membership required to download: CCIwithSingleBarColor.cs
Reply With Quote
Thanked by:
  #5 (permalink)
 
Silver Dragon's Avatar
 Silver Dragon 
Cincinnati Ohio
Legendary Master Data Manipulator
 
Experience: Intermediate
Platform: TastyWorks / NT
Broker: TastyWorks /NT
Trading: FX, Stocks, Options
Posts: 2,107 since Feb 2011
Thanks Given: 6,422
Thanks Received: 5,238


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
Elite Membership required to download: TestColorBar.cs
Visit my NexusFi Trade Journal Reply With Quote
Thanked by:
  #6 (permalink)
 
Silver Dragon's Avatar
 Silver Dragon 
Cincinnati Ohio
Legendary Master Data Manipulator
 
Experience: Intermediate
Platform: TastyWorks / NT
Broker: TastyWorks /NT
Trading: FX, Stocks, Options
Posts: 2,107 since Feb 2011
Thanks Given: 6,422
Thanks Received: 5,238

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 NexusFi Trade Journal Reply With Quote
Thanked by:
  #7 (permalink)
 
RJay's Avatar
 RJay 
Hartford, CT. USA
 
Experience: Intermediate
Platform: NinjaTrader
Broker: AMP/CQG, Kinetick
Trading: RTY
Posts: 683 since Jun 2009
Thanks Given: 758
Thanks Received: 787


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 nexusfi.com (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
Thanked by:
  #8 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Frequency: Every few days
Duration: Weeks
Posts: 50,442 since Jun 2009
Thanks Given: 33,215
Thanks Received: 101,603

 
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 the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor
Searching for trading reviews? Review this list
Lifetime Elite Membership: Sign-up for only $149 USD
Exclusive money saving offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
 
aligator's Avatar
 aligator 
Las Vegas, NV
Legendary Market Wizard
 
Experience: Advanced
Platform: Abacus, Slide Rule, HP-65
Trading: Futures, Stocks, Options
Posts: 3,620 since Aug 2010
Thanks Given: 1,071
Thanks Received: 5,992

Gentle People:

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

Visit my NexusFi Trade Journal Started this thread Reply With Quote
  #10 (permalink)
 
Silvester17's Avatar
 Silvester17 
Columbus, OH
Market Wizard
 
Experience: None
Platform: NT 8, TOS
Trading: ES
Posts: 3,603 since Aug 2009
Thanks Given: 5,139
Thanks Received: 11,527



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
Elite Membership required to download: CCIwithSingleBarColor.cs
Reply With Quote
Thanked by:




Last Updated on January 8, 2012


© 2024 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 - Privacy Policy - Downloads - Top
no new posts