![]() |
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
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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 |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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,
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
You're welcome, is the enable parameter for your strategy set to 'true', so it would actually run live on this chart?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
Got it, thanks.
|
|
|
|
|
|
#6 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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. |
|
|
|
|
|
#7 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: May 2012
Posts: 5
Thanks: 0
Thanked 0 times in 0 posts
|
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? |
|
|
|
|
|
#9 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
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
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
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 |