I have defined a set of criterias by which the background color of a chart changes from green while in uptrend to red during downtrend and finally stays white during untrending.
The change of a the color resembles a crossover of moving averages or such but is -rather than the simple crossing- based on a set of multiple criterias.
Is there any method I could use to call the moment of change of color like a crossing with a lookback period and have it spitting out a numeric value or graphical symbols if a secondary set set of criterias during the lookback period gets fullfilled
Here is an example:
1) TrendDirection is defined at the beginning of the script:
enum TrendDirection { Up, Down, Ranging, }
if ( LinReg(20)[0]>= SMA(20)[0] && [COLOR="Red"]background[1][/COLOR]=TrendDirection.Down && Low[0]<LinReg(20)[0] ) { DrawArrowUp("arrow"+CurrentBar, true, 0, low-atr*1, Color.Green); background=TrendDirection.Up; }
Cannot apply indexing with [] to an expression of type 'NinjaTrader.Indicator.MyIndicatorName.TrendDirect ion'
So... Any way around you know of?
Any assistance is well appreciated and I thank you for your attention already in advance
Comment