Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting unrealized pnl

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

    Getting unrealized pnl

    I am trying to get put in a condition that if the unrealised profit is greater than a set amount an action occurs

    if(Position.GetProfitLoss(Close[0], PerformanceUnit.Points >= ProfitTarget)

    I get the following msg

    Operatot '>=' cannot be applied to operands of type 'Ninjatrader.Strategy.performanceunit and double

    #2
    fiddy, looks to me like you just forgot the closing brace for the method call - would the below compile better for you?

    if (Position.GetProfitLoss(Close[0], PerformanceUnit.Points) >= ProfitTarget)

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    152 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    87 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    131 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    127 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    106 views
    0 likes
    Last Post CarlTrading  
    Working...
    X