Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy P&L by Instrument

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

    Strategy P&L by Instrument

    I have some code to implement daily trade stops based on a profit target or a daily loss target. It works fine but my trading plan is to run the strategy on multiple instruments at the same time, but have each strategy stop trading when the daily profit or daily loss target is achieved for that instrument. Is it possible to configure the daily PandL by instrument?
    Here's the command I am currently using to look at daily profit:

    Code:
    double todays_open_and_closed_pnl =  Position.GetProfitLoss(Close[0], PerformanceUnit.Currency) - daily_starting_balance + Performance.AllTrades.TradesPerformance.Currency.CumProfit ;
    Thanks for your help.

    DaveN

    #2
    Hello DaveN,

    Thank you for your post.

    Are you looking to have a set value that can be accessed from different strategies or are you looking to add each instrument to the strategy and disable the strategy when the level is reached?

    So essentially are we looking at multiple strategies or just one strategy with multiple instruments?

    I look forward to your response.

    Comment


      #3
      I was thinking multiple strategies. each with one instrument.

      Comment


        #4
        Hello DaveN,

        Thank you for that information.

        On the following part of your inquiry, are you looking for a set value used by all strategies? Or each instrument has it's own value within the strategy?
        ...have each strategy stop trading when the daily profit or daily loss target is achieved for that instrument.
        I look forward to your response.

        Comment


          #5
          Preferably the daily stop and profit target would be specific to each instrument, and each instrument would be trading on a different chart, but all strategies would be trading within the same account.

          Comment


            #6
            Hello DaveN,

            Thank you for your response.

            The Performance values pulled from within a NinjaScript Strategy are strategy specific, not account or instrument.

            So you could potentially do as you wish but must keep in mind it is not instrument specific but each instance of the strategy.

            Please let me know if you have any questions.

            Comment


              #7
              So as long as each instance of the strategy has a different name, then my performance value returned from the call will be specific to that strategy? The strategy itself is unique to the instrument because I use an indicator which is specific to each instrument, so by definition I am running a unique and differently named strategy for each instrument. Sounds like it will work exactly the way I want.
              Thanks for your help.
              DaveN

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:10 AM
              0 responses
              4 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by TradeForge, Today, 02:09 AM
              0 responses
              9 views
              0 likes
              Last Post TradeForge  
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by elirion, Today, 01:36 AM
              0 responses
              4 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by gentlebenthebear, Today, 01:30 AM
              0 responses
              4 views
              0 likes
              Last Post gentlebenthebear  
              Working...
              X