Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Realized PnL in the strategy builder

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

    Realized PnL in the strategy builder

    So what does this do?

    Because what it doesn't do when its added is place any trades at all, no matter what settings are chosen within it (currency, percent, ticks etc) and it also doesnt seem to return any useful searches via google for more information on it.

    The most intuitive way to use the thing would be to set it to only enter trades if the Realized PnL (either of a strategy or an account) is over or under a numeric threshold in whatever unit you choose in the strategy builder menu (for example- realized pnl, currency, less than, numeric value 200, sounds like if the realized pnl is over 200 currency, it should return false and return true if the realized pnl is less than 200).

    As I say I have searched pretty hard on this one and have come up blank, which is pretty wild given I've been using ninjatrader for months and have built dozens of complex strategies in the builder or directly in ninjascript itself and at no point has searching for an answer come up short before now, on problems that on the surface at least appear like they should be far more complicated to get around.

    #2
    Hello marketraisen,

    Realized PnL is the PnL for completed trades that the strategy has made. The value would initially be 0 and would then go up or down depending on the trades that the strategy makes.

    To use PnL in the builder you also need to account for historical trades, you can find an example of using pnl here: https://forum.ninjatrader.com/forum/...er#post1203124

    Comment


      #3
      Originally posted by NinjaTrader_Jesse View Post
      Hello marketraisen,

      Realized PnL is the PnL for completed trades that the strategy has made. The value would initially be 0 and would then go up or down depending on the trades that the strategy makes.
      Is that between enables? All time? Calendar days?
      I have tried setting the strategy to have a condition that the time has to be past a certain point, only loads the current day, on a fresh sim account, so that no historic trades should be in whatever its counting towards realized pnl and yet no trades are triggered when setting the Realized PnL to Currency and for it to be below a numeric value.

      Originally posted by NinjaTrader_Jesse View Post
      Hello marketraisen,

      To use PnL in the builder you also need to account for historical trades, you can find an example of using pnl here: https://forum.ninjatrader.com/forum/...er#post1203124


      I'll check it out.

      Comment


        #4
        Hello marketraisen,

        That is for the historical + realtime trades while the strategy is enabled and is reset each time you restart the strategy.

        The sample that I had linked shows the correct way to account for historical trades and shows how to use the PnL value in a condition.

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          Hello marketraisen,

          That is for the historical + realtime trades while the strategy is enabled and is reset each time you restart the strategy.

          The sample that I had linked shows the correct way to account for historical trades and shows how to use the PnL value in a condition.
          Yes I am tinkering with it now so that rather than stopping at a daily loss, it stops at a daily profit target.

          Thank you

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Today, 05:17 AM
          0 responses
          41 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          124 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          64 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          41 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          46 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X