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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    54 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    25 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    17 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    23 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    24 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X