I have developed one indicator MoneyWizard. I have exported the indicator (Export NinjaScript) with the option "Export compiled assembly of selected source file " in a dll file.
MoneyWizard uses some of the imported indicator with source code.
Now I'm testing my indicator in other PC.
If in the other PC don't have installed the other indicators (HilbertTransform and HomodyneDiscriminator), I can import MoneyWizard (dll file).
But If the other PC have installed the others indicator (HilbertTransform and HomodyneDiscriminator) I can't import MoneyWizard (dll file). I get:
"Import failed. The NinjaScrit Archive File may contain duplicate method names already exist on your PC o required missing on their your PC or in the import archive.
In the MoneyWizard.cs export file I see:
namespace NinjaTrader.Indicator
{
public partial class Indicator : IndicatorBase
{
private HilbertTransform[] cacheHilbertTransform = null;
private HomodyneDiscriminator[] cacheHomodyneDiscriminator = null;
private MoneyWizard[] cacheMoneyWizard = null;
private static HilbertTransform checkHilbertTransform = new HilbertTransform();
private static HomodyneDiscriminator checkHomodyneDiscriminator = new HomodyneDiscriminator();
private static MoneyWizard checkMoneyWizard = new MoneyWizard();
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public HilbertTransform HilbertTransform(int wMAPeriods)
{
return HilbertTransform(Input, wMAPeriods);
}
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public HilbertTransform HilbertTransform(Data.IDataSeries input, int wMAPeriods)
{
if (cacheHilbertTransform != null)
for (int idx = 0; idx < cacheHilbertTransform.Length; idx++)
if (cacheHilbertTransform[idx].WMAPeriods == wMAPeriods && cacheHilbertTransform[idx].EqualsInput(input))
return cacheHilbertTransform[idx];
lock (checkHilbertTransform)
{
checkHilbertTransform.WMAPeriods = wMAPeriods;
wMAPeriods = checkHilbertTransform.WMAPeriods;
if (cacheHilbertTransform != null)
for (int idx = 0; idx < cacheHilbertTransform.Length; idx++)
if (cacheHilbertTransform[idx].WMAPeriods == wMAPeriods && cacheHilbertTransform[idx].EqualsInput(input))
return cacheHilbertTransform[idx];
HilbertTransform indicator = new HilbertTransform();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
indicator.WMAPeriods = wMAPeriods;
Indicators.Add(indicator);
indicator.SetUp();
HilbertTransform[] tmp = new HilbertTransform[cacheHilbertTransform == null ? 1 : cacheHilbertTransform.Length + 1];
if (cacheHilbertTransform != null)
cacheHilbertTransform.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheHilbertTransform = tmp;
return indicator;
}
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public HomodyneDiscriminator HomodyneDiscriminator()
{
return HomodyneDiscriminator(Input);
}
/// <summary>
///
/// </summary>
/// <returns></returns>
public HomodyneDiscriminator HomodyneDiscriminator(Data.IDataSeries input)
{
if (cacheHomodyneDiscriminator != null)
for (int idx = 0; idx < cacheHomodyneDiscriminator.Length; idx++)
if (cacheHomodyneDiscriminator[idx].EqualsInput(input))
return cacheHomodyneDiscriminator[idx];
lock (checkHomodyneDiscriminator)
{
if (cacheHomodyneDiscriminator != null)
for (int idx = 0; idx < cacheHomodyneDiscriminator.Length; idx++)
if (cacheHomodyneDiscriminator[idx].EqualsInput(input))
return cacheHomodyneDiscriminator[idx];
HomodyneDiscriminator indicator = new HomodyneDiscriminator();
indicator.BarsRequired = BarsRequired;
indicator.CalculateOnBarClose = CalculateOnBarClose;
#if NT7
indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
indicator.MaximumBarsLookBack = MaximumBarsLookBack;
#endif
indicator.Input = input;
Indicators.Add(indicator);
indicator.SetUp();
HomodyneDiscriminator[] tmp = new HomodyneDiscriminator[cacheHomodyneDiscriminator == null ? 1 : cacheHomodyneDiscriminator.Length + 1];
if (cacheHomodyneDiscriminator != null)
cacheHomodyneDiscriminator.CopyTo(tmp, 0);
tmp[tmp.Length - 1] = indicator;
cacheHomodyneDiscriminator = tmp;
return indicator;
}
}
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public MoneyWizard MoneyWizard(bool activeAlert, bool autoLimit, int daysToLoad, int inputMaxCount, string levels, bool printOutPut, bool showDoji, bool showIndicator, bool showReset, string timeEnd, string timeStart)
{
return MoneyWizard(Input, activeAlert, autoLimit, daysToLoad, inputMaxCount, levels, printOutPut, showDoji, showIndicator, showReset, timeEnd, timeStart);
}
/// <summary>
/// Enter the description of your new custom indicator here
/// </summary>
/// <returns></returns>
public MoneyWizard MoneyWizard(Data.IDataSeries input, bool activeAlert, bool autoLimit, int daysToLoad, int inputMaxCount, string levels, bool printOutPut, bool showDoji, bool showIndicator, bool showReset, string timeEnd, string timeStart)
{
if (cacheMoneyWizard != null)
for (int idx = 0; idx < cacheMoneyWizard.Length; idx++)
if (cacheMoneyWizard[idx].ActiveAlert == activeAlert && cacheMoneyWizard[idx].AutoLimit == autoLimit && cacheMoneyWizard[idx].DaysToLoad == daysToLoad && cacheMoneyWizard[idx].InputMaxCount == inputMaxCount && cacheMoneyWizard[idx].Levels == levels && cacheMoneyWizard[idx].PrintOutPut == printOutPut && cacheMoneyWizard[idx].ShowDoji == showDoji && cacheMoneyWizard[idx].ShowIndicator == showIndicator && cacheMoneyWizard[idx].ShowReset == showReset && cacheMoneyWizard[idx].TimeEnd == timeEnd && cacheMoneyWizard[idx].TimeStart == timeStart && cacheMoneyWizard[idx].EqualsInput(input))
return cacheMoneyWizard[idx];
lock (checkMoneyWizard)
{
checkMoneyWizard.ActiveAlert = activeAlert;
activeAlert = checkMoneyWizard.ActiveAlert;
checkMoneyWizard.AutoLimit = autoLimit;
autoLimit = checkMoneyWizard.AutoLimit;
checkMoneyWizard.DaysToLoad = daysToLoad;
daysToLoad = checkMoneyWizard.DaysToLoad;
checkMoneyWizard.InputMaxCount = inputMaxCount;
inputMaxCount = checkMoneyWizard.InputMaxCount;
checkMoneyWizard.Levels = levels;
levels = checkMoneyWizard.Levels;
checkMoneyWizard.PrintOutPut = printOutPut;
printOutPut = checkMoneyWizard.PrintOutPut;
checkMoneyWizard.ShowDoji = showDoji;
showDoji = checkMoneyWizard.ShowDoji;
checkMoneyWizard.ShowIndicator = showIndicator;
showIndicator = checkMoneyWizard.ShowIndicator;
checkMoneyWizard.ShowReset = showReset;
showReset = checkMoneyWizard.ShowReset;
checkMoneyWizard.TimeEnd = timeEnd;
timeEnd = checkMoneyWizard.TimeEnd;
checkMoneyWizard.TimeStart = timeStart;
timeStart = checkMoneyWizard.TimeStart;
if (cacheMoneyWizard != null)
for (int idx = 0; idx < cacheMoneyWizard.Length; idx++)
if (cacheMoneyWizard[idx].ActiveAlert == activeAlert && cacheMoneyWizard[idx].AutoLimit == autoLimit && cacheMoneyWizard[idx].DaysToLoad == daysToLoad && cacheMoneyWizard[idx].InputMaxCount == inputMaxCount && cacheMoneyWizard[idx].Levels == levels && cacheMoneyWizard[idx].PrintOutPut == printOutPut && cacheMoneyWizard[idx].ShowDoji == showDoji && cacheMoneyWizard[idx].ShowIndicator == showIndicator && cacheMoneyWizard[idx].ShowReset == showReset && cacheMoneyWizard[idx].TimeEnd == timeEnd && cacheMoneyWizard[idx].TimeStart == timeStart && cacheMoneyWizard[idx].EqualsInput(input))
return cacheMoneyWizard[idx];
MoneyWizard indicator = new MoneyWizard();
indicator.BarsRequired = BarsRequired;
...
}
}
..
How can I do it?
Best
Comment