Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Risk Manager addon issues

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

    Risk Manager addon issues

    I'm trying to create a risk management toll add on which aims to manage account activity based on max daily loss and max daily profit. It supposed to liquidate and prevent further trades for the day once one of these targets are hit. I keep having the following errors when compiling the code which I can't seem to fix:
    NinjaScript File Error Code Line Column
    TKRiskManager.cs Argument 1: cannot convert from 'NinjaTrader.Cbi.Instrument' to 'System.Collections.Generic.ICollection<NinjaTrade r.Cbi.Instrument>' CS1503 74 45
    TKRiskManager.cs Argument 1: cannot convert from 'NinjaTrader.Cbi.Instrument' to 'System.Collections.Generic.ICollection<NinjaTrade r.Cbi.Instrument>' CS1503 79 45
    I have attached the full code in a word document for reference. Can you please help solve these errors.

    Thank you,

    Attached Files

    #2
    Hello snoinvest,

    That is because you are trying to pass a single instrument instead of what it wants which is a list of instruments which could just be a list of 1 instruments.

    There is a sample in the link below that shows the correct syntax.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    579 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X