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 07-10-2007, 08:04 AM   #1
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Default Parameter Driven Line Object Values Do Not Update on Reload

I am trying to create an indicator that will be called from a strategy and wanted to submit a parameter to define a Line object value.

Quote:
Add( new Line(Color.DarkGray, myParamLineValue, "Level1"));
When I add the indicator to a chart (manually or via strategy) it will display a Line object with the value I desiginated in the parameter. However, when I change the parameter and reload the NinjaScript (F5) the Line object will not change and will keep its original value.

Many indicators use Line objects to display critical thresholds from which to evaluate potential setups (i.e., CCI, Stochastics, ADX). When developing a strategy it is useful to Add() an indicator for display purposes as well as call the same indicator for setup logic to ensure "what-you-see-is-what-you-get" within the operations of the strategy. Using this approach you can use the strategy parameters to drive what you see as well as how the strategy works. At the moment it seems like this approach works well for Plot objects but not so well for Line objects as they do not recalculate with each reload. Perhaps there is a setting I am overlooking.

Please confirm. Is the only way to get these values to recalculate properly is to convert the Line objects to Plot objects? Thanks.

Regards,

Whitmark
whitmark is offline  
Reply With Quote
Old 07-10-2007, 08:46 AM   #2
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

>> However, when I change the parameter and reload the NinjaScript (F5) the Line object will not change and will keep its original value.
Correct. This is expected behavior.
NinjaTrader_Dierk is offline  
Reply With Quote
Old 07-10-2007, 10:40 AM   #3
whitmark
Certified NinjaScript Consultant
 
Join Date: Nov 2005
Location: Virginia, USA
Posts: 441
Thanks: 0
Thanked 12 times in 7 posts
Send a message via Skype™ to whitmark
Default

Thanks for the clarification. Given the current implementation, I can see why Line object values don't change for the same reason other settings in the parameter dialog don't change on a reload. However, for the use case I described in my orginial post, I would contend that many a standard indicator that use Line objects would benefit from being dynamically driven from an indicator parameter vs hardcoded such that NinjaScript strategies (including optimizations) can change these values on the fly as well and modify the resulting chart display on a reload. Sure, these indicators can be customized easily enough using Plots but as you know, Plots objects don't extend out to the right margin like Line objects, Plots display price markers that can't be turned off by individual plot, and Plot objects are much more memory intensive than a single value Line object. Perhaps its time to consider a separate Dynamic vs Static Line objects? Just a thought

Regards,

Whitmark
Last edited by whitmark; 07-10-2007 at 11:06 AM.
whitmark is offline  
Reply With Quote
Old 07-10-2007, 11:10 AM   #4
NinjaTrader_Dierk
Administrator
 
NinjaTrader_Dierk's Avatar
 
Join Date: Mar 2005
Location: Bamberg, Germany
Posts: 9,994
Thanks: 0
Thanked 6 times in 6 posts
Default

Thanks for your suggestion. We'll add them to the list of future considerations.
NinjaTrader_Dierk 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
Getting draw object information SuzyG Strategy Development 3 05-22-2008 01:37 PM
Error: Object reference not set to an instance of an object. Januson Market Analyzer 1 05-18-2007 12:12 AM
PlotStyle.Line Across UnSet Values whitmark Indicator Development 4 03-30-2007 01:14 AM
Broker Driven Charts whitmark Connecting 1 03-29-2007 04:30 AM
Super Dome did not reload after a reboot Shiva Swinger Miscellaneous Support 1 12-06-2005 02:58 AM


All times are GMT -6. The time now is 05:02 PM.