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 CarlTrading, 03-31-2026, 09:41 PM
    1 response
    80 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    63 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    63 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    54 views
    0 likes
    Last Post CarlTrading  
    Working...
    X