NexusFi: Find Your Edge


Home Menu

 





help modifying the OHLC bar chart


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one asf008005 with 2 posts (0 thanks)
    2. looks_two Big Mike with 1 posts (0 thanks)
    3. looks_3 Quick Summary with 1 posts (0 thanks)
    4. looks_4 cory with 1 posts (5 thanks)
    1. trending_up 2,655 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 4 posts
    2. attach_file 2 attachments




 
Search this Thread

help modifying the OHLC bar chart

  #1 (permalink)
asf008005
Hartford CT
 
Posts: 6 since May 2012
Thanks Given: 6
Thanks Received: 0

hi,
I just started with ninjatrader and need some help modifying the OHLC bar chart. I would like the bars to be colored based on the previous bar's close, on all time frames.
up(green)=close>prev close
down(red)=close<prev close

Fat Tails was generous enough to help code the price bars.
private override void Initialize()
{
CalculateOnBarClose = false;
}

private override void OnBarUpdate()
{
if (CurrentBar < 1)
return;
if(Close[0] > Close[1])
BarColor = Color.LimeGreen;
else if (Close[0] < Close[1])
BarColor = Color.Red;
else
BarColor = Color.Orange;
}

However, I forgot to mention I would like the volume bars to be set-up the same way. So now I need this code to be modified to work with volume bars. I sent ninja an email requesting a license upgrade so I can try coding myself, we'll see.

Thanks-
Andrew

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Exit Strategy
NinjaTrader
New Micros: Ultra 10-Year & Ultra T-Bond -- Live Now
Treasury Notes and Bonds
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Futures True Range Report
The Elite Circle
 
  #3 (permalink)
 
cory's Avatar
 cory 
virginia
 
Experience: Intermediate
Platform: ninja
Trading: NQ
Posts: 6,098 since Jun 2009
Thanks Given: 877
Thanks Received: 8,090


coloring other stuff than price bar is more elaborate, in this case you have 3 colors so you have to add 3 color plots.
ps. the secrete sauce to draw on both panels is to declare "Overlay = false;" then set it to true/false as needed.


asf008005 View Post
hi,
I just started with ninjatrader and need some help modifying the OHLC bar chart. I would like the bars to be colored based on the previous bar's close, on all time frames.
up(green)=close>prev close
down(red)=close<prev close

Fat Tails was generous enough to help code the price bars.
private override void Initialize()
{
CalculateOnBarClose = false;
}

private override void OnBarUpdate()
{
if (CurrentBar < 1)
return;
if(Close[0] > Close[1])
BarColor = Color.LimeGreen;
else if (Close[0] < Close[1])
BarColor = Color.Red;
else
BarColor = Color.Orange;
}

However, I forgot to mention I would like the volume bars to be set-up the same way. So now I need this code to be modified to work with volume bars. I sent ninja an email requesting a license upgrade so I can try coding myself, we'll see.

Thanks-
Andrew


Attached Thumbnails
Click image for larger version

Name:	CL 07-12 (133 Tick)  5_29_2012.jpg
Views:	222
Size:	111.9 KB
ID:	75197  
Attached Files
Elite Membership required to download: MyIndie.zip
Reply With Quote
  #4 (permalink)
asf008005
Hartford CT
 
Posts: 6 since May 2012
Thanks Given: 6
Thanks Received: 0

Cory-
Beautiful! I loaded it on, it looks perfect. Thanks a ton.
I'm so glad I found this forum, everyone has been so helpful!
-Andrew

Reply With Quote
  #5 (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,396 since Jun 2009
Thanks Given: 33,172
Thanks Received: 101,537

Please remember to use the Thanks button.

Also, please use a more descriptive thread title next time. It helps keep things organized. 10,000 threads of "please help" makes things impossible to locate later. I updated your thread title.

Mike

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




Last Updated on May 29, 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