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 rdtdale, Today, 01:02 PM
              0 responses
              2 views
              0 likes
              Last Post rdtdale
              by rdtdale
               
              Started by alifarahani, Today, 09:40 AM
              3 responses
              15 views
              0 likes
              Last Post NinjaTrader_Jesse  
              Started by RookieTrader, Today, 09:37 AM
              4 responses
              18 views
              0 likes
              Last Post RookieTrader  
              Started by PaulMohn, Today, 12:36 PM
              0 responses
              7 views
              0 likes
              Last Post PaulMohn  
              Started by love2code2trade, 04-17-2024, 01:45 PM
              4 responses
              41 views
              0 likes
              Last Post love2code2trade  
              Working...
              X