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 > Strategy Development

Strategy Development Support for the development of custom automated trading strategies using NinjaScript.

Reply
 
Thread Tools Display Modes
Old 07-22-2009, 12:05 AM   #1
Litter@live.com
Junior Member
 
Join Date: Oct 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
Send a message via ICQ to Litter@live.com
Default Adding Indicator to Strategy

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.
Litter@live.com is offline  
Reply With Quote
Old 07-22-2009, 05:04 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

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;
}
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-22-2009, 05:40 AM   #3
Litter@live.com
Junior Member
 
Join Date: Oct 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
Send a message via ICQ to Litter@live.com
Default

.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
Litter@live.com is offline  
Reply With Quote
Old 07-22-2009, 05:51 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

Larry, these are the correct versions -did you gave my posted snippet a try?
NinjaTrader_Bertrand is offline  
Reply With Quote
Old 07-22-2009, 09:00 AM   #5
Litter@live.com
Junior Member
 
Join Date: Oct 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
Send a message via ICQ to Litter@live.com
Default

My version of NinjaTrader does not recognize "ParabolicSARFixed()"

Interestingly ... The price Marker paints the correct color the value plots do not.

- Larry
Litter@live.com is offline  
Reply With Quote
Old 07-22-2009, 09:13 AM   #6
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

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.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-22-2009, 09:34 AM   #7
Litter@live.com
Junior Member
 
Join Date: Oct 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
Send a message via ICQ to Litter@live.com
Default

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.
Litter@live.com is offline  
Reply With Quote
Old 07-22-2009, 10:20 AM   #8
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

Larry,

Will look into it.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-22-2009, 11:01 AM   #9
NinjaTrader_Josh
NinjaTrader Product Manager
 
NinjaTrader_Josh's Avatar
 
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
Default

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.
NinjaTrader_Josh is offline  
Reply With Quote
Old 07-22-2009, 06:47 PM   #10
Litter@live.com
Junior Member
 
Join Date: Oct 2008
Posts: 15
Thanks: 0
Thanked 0 times in 0 posts
Send a message via ICQ to Litter@live.com
Default

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.
Litter@live.com is offline  
Reply With Quote
Old 07-23-2009, 04:01 AM   #11
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

Thanks for reporting this one in Larry, it should be fixed in NinjaTrader 7
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
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


All times are GMT -6. The time now is 05:41 AM.