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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    49 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    69 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    36 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    96 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    59 views
    0 likes
    Last Post PaulMohn  
    Working...
    X