Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profil/Loss for few working strategies

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

    Profil/Loss for few working strategies

    Hi guys,

    I have few strategies that works on NT. Each with daily stop loss and take profit as well.
    I would like to create mechanism/script whatever, that will count realized profit/loss from all working strategies and at some point will disable all.
    Generally a tool for global (account level) risk management.
    My brokerage doesn't offer such support so I need to find solution by myself.

    Can you indicate how to bite it ?

    Thank you in advance

    #2
    Hello KingElephant,

    This is not supported by NinjaTrader to do, however, below I am adding a small tip of unsupported code to help nudge you in the right direction.

    Code:
    foreach (Account acct in Cbi.Globals.Accounts)
    {
    if (acct.Positions != null)
    {
    // print information about each position
    PositionCollection positions = acct.Positions;
    foreach (Position pos in positions)
    {
    Print(pos.Account.Name + " " + pos.Instrument + " " + pos.MarketPosition + " " + pos.Quantity + " " + pos.AvgPrice);
    }
    // print information about each order
    OrderCollection orders = acct.Orders;
    foreach (Order ord in orders)
    {
    Print(ord.ToString());
    }
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    31 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, Yesterday, 02:41 AM
    0 responses
    14 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    22 views
    1 like
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    40 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    34 views
    0 likes
    Last Post CarlTrading  
    Working...
    X