• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Custom Bar Approach?

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

    Custom Bar Approach?

    Hello,

    i am wondering what the best approach to program a custom bar would be?
    Let say i would like to build a bar that would keep bid/ask volume separated and that would respect diagonal prices from the market (not that horizontal stuff that is offered across the platform).
    In the OnDataPoint() ( http://ninjatrader.com/support/helpG...ndatapoint.htm ) reference i can only get the total volume of bid/ask. It looks like i would need to build two bars, one for bid and one for ask, and connect them somehow. Maybe via the Multi- Time Frame & Instruments Method ( http://ninjatrader.com/support/helpG...nstruments.htm ) .
    Does not seem very convenient to me after all.

    What would be the best way to get this done?

    Thanks for your help.

    Regards,

    JenZi

    #2
    Hello JenZi,

    The AddBar() method is able to set the open, high, low, close, time, and volume of the bar.

    Trying to hold two sets of information for a bar and display this would not be possible.

    Instead, you would need two different bar types each holding the 1 set of information for that bar.

    Any information you would want to save from OnDataPoint() could be saved in a custom array or list.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello ChelseaB,

      since the two bars should influence each other (e.g. one reaches a certain price to close both), can they run simultaneously somehow?
      If visualization is not neccessary at all, would it be possible to accomplish that in an indicator? Add the two data streams, separate them into the two bars, calculate and save the needed information and pass it on to a strategy (therefore making the underlying chart minute, range, tick, etc. redundant).

      Comment


        #4
        Hello JenZi,

        Multiple series can be added to an indicator or a strategy using the AddDataSeries() method. You can make any calculations you would like using as many instruments or intervals as you would like in these two types of scripts.

        Bars types cannot have two series. A bar type creates a (single) series.

        Below is a link to an official reference sample that demonstrates how to add intra-bar granularity.
        http://www.ninjatrader.com/support/f...ead.php?t=6652

        As well as a link to the help guide on the AddDataSeries() method.
        http://ninjatrader.com/support/helpG...dataseries.htm

        A link to the help guide on BarsInProgress.
        http://ninjatrader.com/support/helpG...inprogress.htm
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by futures2018!, Yesterday, 05:01 PM
        3 responses
        12 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Splex, Today, 12:04 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Jim  
        Started by n8dogg59, Today, 06:55 AM
        0 responses
        3 views
        0 likes
        Last Post n8dogg59  
        Started by Tradarr, Yesterday, 07:13 PM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_PatrickG  
        Started by unlobotrader, Today, 02:46 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_ChristopherS  
        Working...
        X