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

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.
    Gaby V.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by fx.practic, 10-15-2013, 12:53 AM
    5 responses
    5,404 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by Shai Samuel, 07-02-2022, 02:46 PM
    4 responses
    95 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by DJ888, Yesterday, 10:57 PM
    0 responses
    8 views
    0 likes
    Last Post DJ888
    by DJ888
     
    Started by MacDad, 02-25-2024, 11:48 PM
    7 responses
    159 views
    0 likes
    Last Post loganjarosz123  
    Started by Belfortbucks, Yesterday, 09:29 PM
    0 responses
    8 views
    0 likes
    Last Post Belfortbucks  
    Working...
    X