As I'm working on the custom indicator that will read MACD settings and the macd/avg/hist values (using plots Values[x]) without loading the MACD indicator inside the indicator.
Note: Both custom indicator and MACD indicator are already on the same chart.
I looked at MACD indicator code (at bottom of MACD.cs):
namespace NinjaTrader.NinjaScript.Indicators
{
public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
{
private MACD[] cacheMACD;
public MACD MACD(int fast, int slow, int smooth)
{
return MACD(Input, fast, slow, smooth);
}
public MACD MACD(ISeries<double> input, int fast, int slow, int smooth)
{
if (cacheMACD != null)
for (int idx = 0; idx < cacheMACD.Length; idx++)
if (cacheMACD[idx] != null && cacheMACD[idx].Fast == fast && cacheMACD[idx].Slow == slow && cacheMACD[idx].Smooth == smooth && cacheMACD[idx].EqualsInput(input))
return cacheMACD[idx];
return CacheIndicator<MACD>(new MACD(){ Fast = fast, Slow = slow, Smooth = smooth }, input, ref cacheMACD);
}
}
}
is it possible for you to provide us the basic sample indicator that will allow for accessing to MACD settings and read the values directly without using AddChartIndicator inside the custom indicator?
It will be a big help for us.
Thanks.


Comment