Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    68 views
    0 likes
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    151 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    162 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    100 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    288 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Working...
    X