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

Draw SMA of volume in volume panel

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

    Draw SMA of volume in volume panel

    I want my strategy to display a SMA of volume in the volume panel of the chart.

    If an indicator can't be tied to the volume series directly then I can calculate the values myself, but need to know how I can draw lines on the volume panel using the volume scale.

    #2
    Hello dbooksta,
    Thanks for posting today.

    This can be done by apply the SMA indicator to the volume data series and then moving the SMA into the same panel.
    • From inside a volume chart right mouse click and select Indicators...
    • Select the SMA from the list of indicators.
    • Set the desired settings
    • Left mouse click OK
    • Left mouse click hold and drag and drop the SMA indicator plot into the volume series panel.

    This will accomplish what you are trying to set up with an SMA being plotted on a volume series in the same panel.

    Please let us know if we may be of further assistance for anything NinjaTrader.
    Alex G.NinjaTrader Customer Service

    Comment


      #3
      How can I accomplish the same thing in strategy code? (E.g., in Initialize())

      (And note that I have other indicators that I want displayed on the main panel, so I don't think I can just set DrawOnPricePanel=false.)

      Comment


        #4
        Hello dbooksta,
        Thanks for the reply.

        To include this in the same panel on your strategy your indicator would need to have the Overlay property set to true.

        Here is a link to the Overlay property. http://www.ninjatrader.com/support/h...t7/overlay.htm

        Save the default SMA indicator and add the custom indicator as part of your strategy to be able to use this changed property.

        To do this open the SMA indicator from the editor (Control Center>Tools>Edit NinjaScript>Indicator>SMA>Right click save as...) and then call the newly created custom indicator in your strategy.

        This will then overlay the SMA on your volume chart.

        Please let us know if we may be of further assistance for anything NinjaTrader.
        Alex G.NinjaTrader Customer Service

        Comment


          #5
          I'm confused: The SMA Initialize() already has Overlay = true. So what do I change in code to get it (or a customized SMA Indicator) to overlay the volume panel?

          Note that I have added the volume panel by calling "Add(VOL());" in the strategy's Initialize().

          Update: Actually it looks like the Overlay property is irrelevant. Whether it is true or false I achieve my objective with the following lines in Initialize():
          Code:
          			SMA(VOL(), _volumeBars).Panel = 1;
          			Add(SMA(VOL(), _volumeBars));
          Last edited by dbooksta; 05-29-2015, 06:02 PM.

          Comment


            #6
            Hello,

            For plotting from a strategy, there are two options.

            First option is to create your own indicator that you will Add using the Strategy.
            The indicator will calculate the SMA(VOL(), _volumeBars) and plot it, that is all.
            In the indicator, in Initialize specify Overlay = false;
            This means when the strategy adds it, because it is not overlaying it will be added to a new panel. Because this indicator calculates all the data you need it to, there is nothing else left to do in the strategy.

            The second way would be to use the plotting from a strategy example : http://www.ninjatrader.com/support/f...ead.php?t=6651

            This would be more complicated, the suggested way would be the first, it is generally always a better solution to create a indicator that does all the calculations and plotting and then allow the strategy to use its data for signals.

            I look forward to being of further assistance .
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Haiasi, Today, 06:53 PM
            1 response
            4 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ScottWalsh, Today, 06:52 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ScottW, Today, 06:09 PM
            1 response
            5 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by ftsc2022, 10-25-2022, 12:03 PM
            5 responses
            256 views
            0 likes
            Last Post KeyonMatthews  
            Started by Board game geek, 10-29-2023, 12:00 PM
            14 responses
            244 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Working...
            X