Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Custom Resources in Plots

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

    Custom Resources in Plots

    Developing a new indicator, in NT8.

    I see that there are custom resources, e.g.
    NinjaTrader.Custom.Resource.NinjaScriptIndicatorDi ff

    and there are 'magic' ways to assign values to them, e.g.
    Diff[0]

    Can you please explain how these custom resources work. Are they something that are created by NT, and it is simply exposed for us to use. Also is there a list of them, and list of values that need to be assigned to them

    #2
    Hello,

    Thank you for the inquiry.

    The custom resources are used for internal strings in the platform and are not for assignment. These should generally not be used in your own files. You will see these in stock indicators properties and names, but items you may find online may contain them as well. Using invalid resource names can lead to performance impacts so it would be a good idea to just use a string instead.

    For example:

    this would be invalid because MyPeriod is not a custom resource.
    Code:
    [Display(ResourceType = typeof(Custom.Resource), Name = "MyPeriod", GroupName = "NinjaScriptParameters", Order = 0)]
    public int MyPeriod {get;set;}
    instead you can remove the resource type all together:
    Code:
    [Display(Name = "MyPeriod", GroupName = "NinjaScriptParameters", Order = 0)]
    public int MyPeriod {get;set;}
    Another example would be in file naming:

    These would be valid for the SMA, because they provide a string for the Description and Name specifically for the SMA.
    Code:
    if (State == State.SetDefaults)
    {
    	Description = NinjaTrader.Custom.Resource.NinjaScriptIndicatorDescriptionSMA;
    	Name = NinjaTrader.Custom.Resource.NinjaScriptIndicatorNameSMA;
    }
    For a custom item, you would instead use a string:
    Code:
    if (State == State.SetDefaults)
    {
    	Description = "Some Description";
    	Name = "MyCustomName";
    }
    Diff[0] would likely be a Series in the script you are working with which is a different concept: http://ninjatrader.com/support/helpG...ightsub=series

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by funk10101, Today, 09:43 PM
    0 responses
    6 views
    0 likes
    Last Post funk10101  
    Started by pkefal, 04-11-2024, 07:39 AM
    11 responses
    37 views
    0 likes
    Last Post jeronymite  
    Started by bill2023, Yesterday, 08:51 AM
    8 responses
    44 views
    0 likes
    Last Post bill2023  
    Started by yertle, Today, 08:38 AM
    6 responses
    26 views
    0 likes
    Last Post ryjoga
    by ryjoga
     
    Started by algospoke, Yesterday, 06:40 PM
    2 responses
    24 views
    0 likes
    Last Post algospoke  
    Working...
    X