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