• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

import dll error override indicator

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    import dll error override indicator

    I have imported some indicators: HilbertTransform and HomodyneDiscriminator (Import NinjaScript). This indicators have their source code.

    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

    #2
    Hello,

    Thank you for your note.

    It looks like these indicators are referenced by the MoneyWizard script. In which case they are being included with the export as all dependencies will be included with the export.

    If this is the case, you will need to ensure that these indicators are not already on the system you are importing to. If they are, remove them first as they are now included with the exported assembly of MoneyWizard.
    Last edited by NinjaTrader_ChelseaB; 01-21-2015, 11:25 AM.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by allinthechart, Today, 12:21 PM
    0 responses
    2 views
    0 likes
    Last Post allinthechart  
    Started by srbdoc, Today, 11:21 AM
    2 responses
    9 views
    0 likes
    Last Post NinjaTrader_PatrickG  
    Started by TazoTodua, Today, 11:20 AM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jim  
    Started by TazoTodua, Today, 11:19 AM
    0 responses
    6 views
    0 likes
    Last Post TazoTodua  
    Started by sdauteuil, Today, 10:22 AM
    6 responses
    16 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X