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 aussugardefender, Today, 01:07 AM
    0 responses
    3 views
    0 likes
    Last Post aussugardefender  
    Started by pvincent, 06-23-2022, 12:53 PM
    14 responses
    238 views
    0 likes
    Last Post Nyman
    by Nyman
     
    Started by TraderG23, 12-08-2023, 07:56 AM
    9 responses
    383 views
    1 like
    Last Post Gavini
    by Gavini
     
    Started by oviejo, Today, 12:28 AM
    0 responses
    4 views
    0 likes
    Last Post oviejo
    by oviejo
     
    Started by pechtri, 06-22-2023, 02:31 AM
    10 responses
    125 views
    0 likes
    Last Post Leeroy_Jenkins  
    Working...
    X