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

Easiest way to plot a value from within a strategy?

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

    Easiest way to plot a value from within a strategy?

    What is the easiest way to plot a value from within a strategy?

    For example I have some intermediate result from a calculation that I want to plot for debugging purposes. It seems to work different compared to indicators.

    Sorry I'm asking quite basic questions. I'm not yet familiar with C#, always used EL before.

    #2
    Please check out the docs: http://www.ninjatrader-support.com/H...eV6/Print.html

    Works the same for strategies and indicators.

    Comment


      #3
      Originally posted by NinjaTrader_Dierk View Post
      Please check out the docs: http://www.ninjatrader-support.com/H...eV6/Print.html

      Works the same for strategies and indicators.
      I mean plotting a value as a graph, like an indicator.

      Comment


        #4
        a) You can not plot an "intermediate result from a calculation" on chart like an indicator, you only can plot actual values of a calculation to the output window using the Print() statement.

        b) Please see SampleMACrossStrategy for how to add an indicator plot to a chart as the strategy is executed on chart.

        Comment


          #5
          Yes I had looked at that already.
          But there you already have an indicator that you can plot and call from your strategy.

          What I would like to do for example is to plot the bid-ask spread along with the strategy that I'm testing. I guess I can create an indicator for this and then plot that indicator from within my strategy like in the SMACross example. But I was wondering if there is a quick and easy way to do something like that quickly directly from within the strategy.

          Sometimes it is useful to plot some 'internal' parameter as a graph for debugging purposes (this is what I meant) but I prefer not to create an indicator when I want to do that.

          I hope you get my idea (sorry for my not so clear initial explanation) but maybe there is no simple way to do this.

          Comment


            #6
            Right, as you already figured you would need to code an indicator or code additional plot series for the indicator, holding temporary calculation values.

            Comment


              #7
              FireFly,

              I appreciate your post and agree, it would be nice to have "one-the-fly" plotting capabilities from NinjaScript strategies without the need to prepare a separate indicator. But keep in mind you can also push out intermediate values with a bar identifier timestamp to the output window using the Print statement for debugging purposes although I realize this may not be as convenient or as useful as a plot on a chart.

              Regards,

              Whitmark
              whitmark
              NinjaTrader Ecosystem Vendor - Whitmark Development

              Comment


                #8
                Originally posted by whitmark View Post
                FireFly,

                I appreciate your post and agree, it would be nice to have "one-the-fly" plotting capabilities from NinjaScript strategies without the need to prepare a separate indicator. But keep in mind you can also push out intermediate values with a bar identifier timestamp to the output window using the Print statement for debugging purposes although I realize this may not be as convenient or as useful as a plot on a chart.

                Regards,

                Whitmark
                Yes, this is exactly how I have been doing it up to now.
                Just wondering if there is still some way to plot it...

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                3 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                18 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                1 view
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                6 views
                0 likes
                Last Post Javierw.ok  
                Started by timmbbo, Today, 08:59 AM
                2 responses
                10 views
                0 likes
                Last Post bltdavid  
                Working...
                X