Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Naming a copied indicator

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

    Naming a copied indicator

    Hello,
    In the ninjascript editor, I used "save as" to make a copy of the "PriceLine" indicator. I got a message about changing the name in OnStateChange() to prevent duplicate indicators showing in the indicator drop list.

    Here's how the copied indicator file "PriceLineTemp" appears. Can you show me an example of what to change in order to have Price Line Temp show in my indicator list? I currently have 2 Price Line indicators listed in the drop list. I tried to edit the areas in bold red text below. I got a message about NinjaTrader.Custom.Resource does not have a definition for that new name..
    //This namespace holds Indicators in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.Indicators
    {
    /// <summary>
    /// Displays ask, bid, and/or last lines on the chart.
    /// </summary>
    public class PriceLineTemp : Indicator
    {
    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = Custom.Resource.NinjaScriptIndicatorDescription
    PriceLineTemp;
    Name = Custom.Resource.NinjaScriptIndicatorName
    PriceLineTemp;
    Calculate = Calculate.OnPriceChange;
    IsOverlay = true;
    ShowTransparentPlotsInDataBox = false;
    DrawOnPricePanel = true;
    IsSuspendedWhileInactive = true;
    ShowAskLine = false;
    ShowBidLine = false;
    ShowLastLine = true;
    AskLineLength = 100;
    BidLineLength = 100;
    LastLineLength = 100;
    AskStroke = new Stroke(Brushes.DarkGreen, DashStyleHelper.Dash, 1);
    BidStroke = new Stroke(Brushes.Blue, DashStyleHelper.Dash, 1);
    LastStroke = new Stroke(Brushes.Yellow, DashStyleHelper.Dash, 1);
    }​​
    Thanks.

    #2
    Hello BerryTrader,

    Thank you for your post.

    Instead of using Custom.Resource.NinjaScriptIndicatorDescription in the description and Custom.Resource.NinjaScriptIndicatorName in the name, use your own custom description and name. For example,

    Description = "my PriceLineTemp description";
    Name = "PriceLineTemp";

    After making these changes, compile the script and test to see if you are still seeing the error or unable to see the indicator in the Indicators list.

    Please let me know if I can assist further.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    596 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    554 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X