Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Profit and Loss on chart

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

    Profit and Loss on chart

    I can't read profit and loss on the chart. What methods would I need to use to show profit and loss on the chart.
    Would this be a difficult thing to program? Used to program Java and know a bit of C#.
    Where would I start on this indicator.
    Thanks.

    #2
    Hello Barry Milan,

    Thanks for opening the thread.

    To get Account information from an indicator you must subscribe to AccountItemUpdate events. You can then get AccountItem.RealizedProfitLoss or any other AccountItem updates as they come in.

    I've attached an example indicator that adds this to an indicator and I have attached a link to our documentation page on AccountItemUpdate.

    AccountItemUpdate - https://ninjatrader.com/support/help...itemupdate.htm

    Please let us know if you have any questions.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Profit and Loss

      Does the code you sent me put profit and loss on the chart?

      Comment


        #4
        Hello Barry Milan,

        No, it does not. It shows how AccountItemUpdate can be added to an indicator and prints the updated items in the output window. If you would like to display it on a chart you could use one of the Text Drawing Tools like Draw.Text() or Draw.TextFixed().

        Draw.Text() - https://ninjatrader.com/support/help.../draw_text.htm

        Draw.TextFixed() - https://ninjatrader.com/support/help..._textfixed.htm

        Please let me know if you have any additional questions.
        JimNinjaTrader Customer Service

        Comment


          #5
          Practice

          Hi
          What do you think is the best way to practice ninjascript. I don't want to use my trading setup in case I screw it up.
          What do you recommend the best way? Another computer with a copy of ninjatrader you can screw up is the only way I can think of?
          Thanks

          Comment


            #6
            Hello Barry Milan,

            Thanks for your reply.

            Certainly using another PC would isolate any issues you might encounter.

            In NinjaTrader8, you are able to "exclude" scripts from compiling so if you had an errors they could be kept out of your system. Please see: https://ninjatrader.com/support/help...s_explorer.htm
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hi Jim,
              Any chance you have this available for Ninajtrader 7?

              Comment


                #8
                Hello TickTaker,

                Thanks for your post and welcome to the NinjaTrader forums.

                We do not have an example of this for NinjaTrader7. It is possible to do this, however, it would be using undocumented and unsupported means in NinjaTrader7. As a starting point you can review this thread: https://ninjatrader.com/support/foru...ad.php?t=68029.

                Alternatively and much easier, in NT7 (or NT8) would be to use a Market analyzer window that can display the Unrealized and realized PNL for each instrument. Please see: https://ninjatrader.com/support/help...t_analyzer.htm or for NT8: https://ninjatrader.com/support/help...t_analyzer.htm
                Paul H.NinjaTrader Customer Service

                Comment


                  #9
                  Thanks so much. I will check it out.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by TraderBCL, Today, 04:38 AM
                  2 responses
                  7 views
                  0 likes
                  Last Post TraderBCL  
                  Started by martin70, 03-24-2023, 04:58 AM
                  14 responses
                  105 views
                  0 likes
                  Last Post martin70  
                  Started by Radano, 06-10-2021, 01:40 AM
                  19 responses
                  606 views
                  0 likes
                  Last Post Radano
                  by Radano
                   
                  Started by KenneGaray, Today, 03:48 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post KenneGaray  
                  Started by thanajo, 05-04-2021, 02:11 AM
                  4 responses
                  471 views
                  0 likes
                  Last Post tradingnasdaqprueba  
                  Working...
                  X