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

AddPlot PlotStyle.PriceBox how to use

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

    AddPlot PlotStyle.PriceBox how to use

    I have a custom indicator and I would like to plot it as a bar with a low and a high.

    I'm guessing(since it's not documented anywhere) that PlotStyle.PriceBox is what I'm after, not sure.

    Can anyone shed some light on how to pass my indicator values to a plot with a PlotStyle of PriceBox ?

    I'd like to pass in a high and a low and have bar plot with that high and low.

    I have seen similar questions(around drawing indicators as candlesticks) and the answer is to overload OnRender and manually draw the bars, but before I do that I'd like to make sure that this is the only way to draw a hi-low bar.

    I'm hoping there is some way to take advantage of the existing functionality of NinjaTrader without having to re-implement code that already exists, is well tested, and I don't have to maintain. There are a few other threads around with the same suggestion.

    If there is no way to do what I'm asking, I'd like to request an enhancement to allow this.
    For example, NT already has all the code to draw a candlestick on a pane including high low wick, open close box, outline, scaling, colors, width, all those details are already done, tested and working. Why can't my indicator code create a candlestick plot and provide the open, low, high close and let ninjatrader do what it already knows how to do ? Do I really have to repeat all that code in OnRender ?

    Thanks
    Last edited by michelm; 11-11-2019, 10:18 AM.

    #2
    Hello michelm,

    Thanks for your post.

    PriceBox is used to simply place a price box on the price scale. No plot lines or bars will be constructed with this PlotStyle.

    Plots will represent one Series of data points. Creating a candlestick or another drawing which shows high/low as well as a closing point would require multiple Series of points, each for the high, low and close values. As we would be creating a "Plot" that graphically depicts multiple Series points instead of just one, we will need to perform custom rendering to accomplish the task.

    We have an open source Heiken Ashi indicator that draws its own bars which could be used as reference. I will provide a link below.

    https://ninjatraderecosystem.com/use...heiken-ashi-8/

    Using SharpDX for custom rendering - https://ninjatrader.com/support/help..._rendering.htm

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsinstallibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.

    We are also tracking interest in having a PlotStyle used for drawing candles. This would imply that an AddPlot overload would reflect 4 added plots which would each represent the Open High Low and Close values for the candle. Ticket ID: SFT-2157

    We collect interest in feature requests before determining if the feature should be implemented. For that reason we cannot offer an ETA or promise of fulfillment. Upon implementation, the number for the ticket ID can be publicly found in the Release Notes page of the help guide. I will provide a link below.

    Release Notes - https://ninjatrader.com/support/help...ease_notes.htm

    Please let me know if I can be of further assistance.
    Last edited by NinjaTrader_Jim; 11-11-2019, 10:41 AM.
    JimNinjaTrader Customer Service

    Comment


      #3
      If I have added code of an indicator to use the logic in my code, but part of the code wants to add,and requires there to be Plot Added pre OnBarUpdate, is there a perfered method to requesting the Plots to be Drawn on it's own panel? As the way it working the code does work though when looking at a frames it shows that the Plots are placed on the 0 line of any chart and that is a unique function on each chart and not always in view of the chats current bars.

      Comment


        #4
        Hello LoganJKTrader,

        Plots will be overlaid over the price panel or plotted in the panel added by the script.

        If you want the script's plots/rendering to be in an added panel and not the price panel, you may set IsOverlay to false.

        Note, if you change defaults in State.SetDefaults, the script must be removed and re-added to apply the new defaults.

        IsOverlay - https://ninjatrader.com/support/help...?isoverlay.htm
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by yertle, Yesterday, 08:38 AM
        7 responses
        28 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by bmartz, 03-12-2024, 06:12 AM
        2 responses
        21 views
        0 likes
        Last Post bmartz
        by bmartz
         
        Started by funk10101, Today, 12:02 AM
        0 responses
        5 views
        0 likes
        Last Post funk10101  
        Started by gravdigaz6, Yesterday, 11:40 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by MarianApalaghiei, Yesterday, 10:49 PM
        3 responses
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Working...
        X