Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Calling another custom indicator, error -- the other indicator is a DLL

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

    Calling another custom indicator, error -- the other indicator is a DLL

    hi guys,

    Is there any reason why I cant seem to call values from a custom indicator that works perfectly fine as an indicator on a chart, but I just cant seem to get by errors when I try to call it as a function from a different indicator or strategy (same error).

    What may make this different is that the custom indicator that I am calling to is a DLL compiled indicator. Is this a known issue? I have added the DLL as a reference.

    I initiate it after the class intro bit, as in...
    Code:
    public class MyCustomIndicator1 : Indicator
        {
          MyDLLIndicator mydllind;
    ....
    ...and then I fully initialize it after a check if data has loaded, as in:
    Code:
    else if (State == State.DataLoaded)
                {
                    mydllind = new MyDLLIndicator(Close, 2,4,4,7);
                }
    I have also used instead of the above line, another way, such as:

    Code:
    mydllind = MyDLLIndicator(Close, 2,4,4,7);
    and I always get the error that MyDLLIndicator doesnt have constructors that take 5 inputs (it does), OR, if I init it the other way, the error is that MyDLLIndicator is a type but being used as a variable.

    Any ideas? Thanks,

    JackoOnHisBacko

    #2
    Hello jackoonhisbacko,

    Thank you for the post.

    In NinjaScript you will never use the new modifier when creating an indicator:

    mydllind = new MyDLLIndicator(Close, 2,4,4,7);
    If you are not able to use the following syntax without calling "new" the indicator is not likely programmed in a way to allow for script access:

    mydllind = MyDLLIndicator(Close, 2,4,4,7);
    The code at the end of each indicator file that says to not remove it, if that is removed you can no longer call the indicator in NinjaScript. If the dll indicator lacks that wrapper code that would be one reason why it cannot be accessed in NinjaScript.

    If the DLL indicator is something you have programmed and exported, we could review the code for that indicator to see how it should be called.

    You can use the editors intelleprompt to explore known types, you may try typing some of the indicators name and wait for the drop down list to appear to check for any occurrences of that name in the list. This will populate the syntax if so. Another alternative is to check using the Strategy Builder to see if its listed. If so try making a condition and click View Code.




    I look forward to being of further assistance.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    648 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    573 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    575 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X