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

want to have 2 parameters. i am not able to set it correctly

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

    want to have 2 parameters. i am not able to set it correctly

    i want to have 2 parameters that the strategy can invoke ie AddChartIndicator(ProfitabilityPlots(<jsonFileName >,<What2Show>)
    it currently only allows 1 parameter ie AddChartIndicator(ProfitabilityPlots(<jsonFileName >)

    i dont know what mistake i am making in my properties section.
    #region Properties
    [NinjaScriptProperty]
    [Display(Name = "JsonFile", Description = "ProfitFeed", Order = 1, GroupName = "Parameters")]
    public string JsonFile
    { get; set; }

    [NinjaScriptProperty]
    [Display(Name = "What2Show", Description = "choose EquityCurve or IndividualTrade ", Order = 2, GroupName = "Parameters")]

    public string What2Show
    { get; set; }
    Attached Files

    #2
    Hello junkone,

    Thanks for your post.

    Your code does not compile as is and I have commented out some Json related code to ensure it compiles. Please be sure to provide source code exports to include all dependencies so scripts can be compiled and tested.

    When I make modifications and compile the indicator and add it in the Strategy Builder with Plot On Chart checked, I get the following syntax:

    Code:
    else if (State == State.DataLoaded)
    {
    ProfitabilityPlots1 = ProfitabilityPlots(Close, @"", @""); // First string is jsonFile, and the second string is what2Show
    ProfitabilityPlots1.Plots[0].Brush = Brushes.Orange;
    ProfitabilityPlots1.Plots[1].Brush = Brushes.Orange;
    ProfitabilityPlots1.Plots[2].Brush = Brushes.Green;
    ProfitabilityPlots1.Plots[3].Brush = Brushes.Red;
    ProfitabilityPlots1.Plots[4].Brush = Brushes.Yellow;
    AddChartIndicator(ProfitabilityPlots1);
    }
    Do you get the same when you have the Strategy Builder generate syntax? It is working for me.

    I look forward to assisting.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by rayyyu12, Today, 05:38 PM
    0 responses
    12 views
    0 likes
    Last Post rayyyu12  
    Started by xepher101, Yesterday, 12:19 PM
    2 responses
    29 views
    0 likes
    Last Post xepher101  
    Started by thumper57, Today, 04:30 PM
    0 responses
    8 views
    0 likes
    Last Post thumper57  
    Started by OllieFeraher, 05-09-2024, 11:14 AM
    5 responses
    16 views
    0 likes
    Last Post MisterTee  
    Started by jackiegils, Yesterday, 11:05 PM
    1 response
    11 views
    0 likes
    Last Post marcus2300  
    Working...
    X