Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PNL not showing when using startegy?

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

    PNL not showing when using startegy?

    When placing a trade PNL shows normally as my setting £, but when I use a stategy to place a trade all I get is £0 that goes red or green and doesn't show any value ?
    If I click the PNL panel it will show PIPS and % but not the currency ?

    I am using Sim101 account on Demo

    Many thanks

    #2
    Hello fredfred123,

    Thank you for the post.

    Your NinjaScript Strategy is making profit/loss that is less than 0.01. If you have access to the code of this strategy, you may use Print() statements to print out your current PnL like so:

    Code:
    Print("Open PnL: " + Position.GetUnrealizedProfitLoss(PerformanceUnit.Points, Close[0]))
    More on GetUnrealizedProfitLoss here:


    You must also specify the literal quantity of the lot size, so entering long on a mini lot would look like this:

    Code:
    EnterLong(10000);
    Please let us know if we may be of any further assistance.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Okay thank you

      So that when I enter a trade with chart trader I will get PnL,but not with the stategy. I would have to enter the script to allow this?

      I am using the strategy builder and don't want to unlock the code, is there a way of doing this in another way through the strategy builder perhaps ?

      Many thanks

      Comment


        #4
        Hello fredfred123,

        Thank you for the reply.

        From the Conditions and Actions menu, add an action. Then, goto Misc>Print>Set>Set String0>Strategy>Unrealized PnL>OK. Then open up a new NinjaScript Output (New>NinjaScript Output) and you will see your PnL printing when the strategy is running on the chart.

        Please let us know if we may be of any further assistance.
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          Hi Chris

          I tried the method you have posted but I get a long string of numbers and a letter E in it?

          If I try this strategy with playback I see the PnL on the chart trader?

          Comment


            #6
            Hello,

            Thank you for the follow up.

            That is scientific notation. The values are quite small, that is why your PnL was left at zero
            (0) but the zero was still changing from green to red. What lot size are you trading for this instrument?

            I look forward to your reply.
            Chris L.NinjaTrader Customer Service

            Comment


              #7
              Hi
              understood, I was putting the wrong lot size in the strategy.

              Many thanks

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by usazencort, Today, 01:16 AM
              0 responses
              1 view
              0 likes
              Last Post usazencort  
              Started by kaywai, 09-01-2023, 08:44 PM
              5 responses
              603 views
              0 likes
              Last Post NinjaTrader_Jason  
              Started by xiinteractive, 04-09-2024, 08:08 AM
              6 responses
              22 views
              0 likes
              Last Post xiinteractive  
              Started by Pattontje, Yesterday, 02:10 PM
              2 responses
              21 views
              0 likes
              Last Post Pattontje  
              Started by flybuzz, 04-21-2024, 04:07 PM
              17 responses
              230 views
              0 likes
              Last Post TradingLoss  
              Working...
              X