![]() |
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
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Junior Member
|
I am attempting to add the ParabolicSAR to my strategy.
I am able to Add() the indicator and have it plot to my chart. The problem is that I have been unable to find a way to change the plot attributes for the indicator. I would like to change the color and name associated with it. Below is the Code that I am using. protectedoverridevoid Initialize() { ParabolicSAR(0.02, 0.2, 0.02).Plots[0].Name = "ParSAR"; ParabolicSAR(0.02, 0.2, 0.02).Plots[0].Pen.Color = Color.Blue; Add(ParabolicSAR(0.02, 0.2, 0.02)); CalculateOnBarClose = true; } protectedoverridevoid OnBarUpdate() { // Working Code } publicoverridestring ToString() { return" "; } Any assistance would be greatly appreciated. Thanks. Larry. |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Larry, which NinjaTrader version are you running? You can check under Help > About - I tested your code with the fixed Parabolic version and it does work as expected -
Code:
protected override void Initialize()
{
ParabolicSARFixed(0.02, 0.2, 0.02).Plots[0].Pen.Color = Color.Blue;
Add(ParabolicSARFixed(0.02, 0.2, 0.02));
CalculateOnBarClose = true;
}
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
|
.NET Version: 2.0.50727.3082
Ninja Trader Version: 6.5.1000.11 =========== Perhaps my setups for the chart and strategy are not set properly. Thanks. Larry |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Larry, these are the correct versions -did you gave my posted snippet a try?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
|
My version of NinjaTrader does not recognize "ParabolicSARFixed()"
Interestingly ... The price Marker paints the correct color the value plots do not. - Larry |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Larry,
Please disregard the "fixed" part and use the regular ParabolicSAR(). The price markers should show the same value as the plot on the last bar.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#7 |
|
Junior Member
|
Hi Josh,
Yes the ParSAR is correctly plotting the values. I was attempting to change the attributes of the plot .. i.e. the color, the name that displays on the chart - such that I could display different names for the different setups in different colors. I can get the price marker to the new color of Blue ... The parSAR dots are still the deualt Orange. I wanted to be able to identify my plots from the default indicator color. |
|
|
|
|
|
#8 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Larry,
Will look into it.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#9 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Larry,
Could be a bug. Thank you for reporting. In the meantime, you can bring up the indicators dialogue and then close it to get it to show up as blue.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#10 |
|
Junior Member
|
Yes - that is a work around. Bringing the indicator window active and applying to the chart will change the color to that of my Strategy.
Thanks for your help. Looking forward to the upcomming fix. |
|
|
|
|
|
#11 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,421
Thanks: 252
Thanked 982 times in 964 posts
|
Thanks for reporting this one in Larry, it should be fixed in NinjaTrader 7
Bertrand
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Momentum indicator - adding lines | tradeby | Indicator Development | 3 | 07-20-2009 06:53 AM |
| Adding indicator for secondary instrument | j0hnth0m | Strategy Development | 1 | 03-26-2009 04:31 AM |
| Adding moving average to indicator | winja | Indicator Development | 3 | 02-24-2009 09:43 AM |
| Adding Indicator Color Lines to Strategy | duck_CA | Strategy Development | 2 | 02-21-2009 09:14 PM |
| Adding Indicator to Strategy not working | ATI user | Strategy Development | 12 | 12-18-2008 01:49 PM |