whitmark
07-10-2007, 08:04 AM
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.
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
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