NinjaTrader Support Forum  
X

Attention!

This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com


Go Back   NinjaTrader Support Forum > NinjaScript Development Support > Indicator Development

Indicator Development Support for the development of custom indicators using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 05-22-2012, 10:37 PM   #1
BBilotta
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default New and need help w MACD changing bar colors

Hi,

I'm new to this forum and new to Ninja script and am hoping someone can get me started on programming my bar charts to change color with certain MACD conditions.

Very simply I want the bar to turn green if the MACD is both above the signal line and above zero. I want the bar to turn red if the MACD is both below the signal line and below zero.

Thanks,
BB
BBilotta is offline  
Reply With Quote
Old 05-23-2012, 03:09 AM   #2
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

BB, welcome to our forums - without diving fully into custom this script via NinjaScript / C# you could use our point and click strategy wizard interface to create this coloring for your chart via a Strategy.

http://www.ninjatrader.com/support/h...rd_screens.htm

I've attached your little example as a courtesy to get started down this path easier.

You can import the zip file via File > Utilities > Import NinjaScript.

Play around with it and good luck,
Attached Files
File Type: zip BBMACD.zip (4.3 KB, 28 views)
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-23-2012, 07:20 AM   #3
BBilotta
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand,

Thank you for the start, I appreciate the help. Unfortunately, it didnt work. I plugged it into a range bar chart and all the HLOC bars remained black. Is there some way i'm not aware of to implement the strategy?
BBilotta is offline  
Reply With Quote
Old 05-23-2012, 07:21 AM   #4
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

You're welcome, is the enable parameter for your strategy set to 'true', so it would actually run live on this chart?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 05-23-2012, 07:35 AM   #5
BBilotta
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Got it, thanks.
BBilotta is offline  
Reply With Quote
Old 06-18-2012, 07:44 AM   #6
BBilotta
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

Bertrand,
Thank you again for the strategy, it's working just fine. I did have to remove and reinstall NT, so I had to come find it again to reload it.

I was wondering if there's anything that could be done to allow me to use what you created AND chart trader. Right now, as you probably already know, the strategy disables chart trader. And, if you were using a strategy to actually place trades, that might make sense.
BBilotta is offline  
Reply With Quote
Old 06-18-2012, 07:48 AM   #7
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Glad to hear it's working fine for you BB, unfortunately it would be either ChartTrader activated or a Strategy running on the chart - we have allowing both items on our list of feedback in product management and I've surely added your vote in here as well.

A workaround would be either using 2 charts, one for the strategy, the other for ChartTrader or just entering orders over the DOM interface while having the chart on the side.

Yet another would be using custom coding to convert the analysis of the strategy to an indicator so you would apply it to a chart with ChartTrader enabled.
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 06-18-2012, 08:28 AM   #8
BBilotta
Junior Member
 
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
Default

i figured the custom code would be the answer for now. Using two charts is not very efficient. You could get used to it, just not what I want to end up with.

I'll wait a little while and see what happens with the next few updates. If it does come down to custom code, do you have any suggestions you could PM to me?
BBilotta is offline  
Reply With Quote
Old 06-18-2012, 09:08 AM   #9
NinjaTrader_Bertrand
NinjaTrader Customer Service
 
NinjaTrader_Bertrand's Avatar
 
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
Default

Correct, for now it would come down to moving your script to an indicator based one via custom coding.

To get started down this path, I would suggest working through those tutorials -

http://www.ninjatrader.com/support/h.../tutorials.htm

If you would prefer to get this ported professionally for you, a NinjaScript consultant could assist in the process - http://www.ninjatrader.com/partners#...pt-Consultants
NinjaTrader_Bertrand is offline  
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
MACD ZeroLag w/Colors ctrlbrk Indicator Development 23 11-23-2011 06:17 PM
Changing colors of drawings lookOutBelow General Programming 2 11-03-2010 11:07 AM
Changing Colors tquinn Indicator Development 5 03-01-2010 06:20 AM
Changing colors of a plot BobTN Indicator Development 3 02-24-2010 01:03 PM
up/down different colors for macd hist zq655 Charting 5 01-28-2008 07:16 PM


All times are GMT -6. The time now is 07:18 PM.