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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    639 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    366 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    107 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    569 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    572 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X