I created a StringSeries value in an indicator using the following code:
Indicator name = rcsHeikenAshi
#region Variables
private StringSeries heikenAshiDirection;
...
protected override void Initialize()
heikenAshiDirection = new StringSeries(this);
..
later in code ..
heikenAshiDirection.Set(0,"red");
#properties
[Browsable(false)]
[XmlIgnore()]
public StringSeries HeikenAshiDirection
{
get { return heikenAshiDirection; }
}
Then in a STRATEGY, I try to access the value using ..
if ( rcsHA == null ) { rcsHA = rcsHeikenAshi(); }
if ( rcsHA.HeikenAshiDirection[0] == "blue" ) { haColor = "blue"; }
if ( rcsHA.HeikenAshiDirection[0] == "red" ) { haColor = "red"; }
This is not working. If I put PRINT values in the indicator, rcsHeikenAshi, I see that heikenAshiDirection is being updated correctly, but I can't access the values from the strategy.
I've coded this sequence many times in the past, without error. The only difference I can see is that there are zero parameters for rcsHeikenAshi. All the other indicators I've used has had at least one parameter. So for example, if rcsHeikenAshi had a bool value for a parameter, I would code "rcsHeikenAshi(true)".
Does it make a difference that the indicator has zero parameters? Do I have the syntax correct?
Thanks

Comment