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