• 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

Volumetric Bars Type for Custom Bars Type.

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

    Volumetric Bars Type for Custom Bars Type.

    Hello,

    as it doesn't seem to be possible to create a volumetric chart from a custom bars type, i wonder if it would be possible to create an own bars type which includes additional data just like the volumetric bars type does?

    from the help guide i see that there is an additional array called Volumes:

    Code:
    Print("Trades: " + barsType.Volumes[CurrentBar].Trades);
    would it be possible to do something similar with a custom bars type?

    Background is that i am currently using orderflow in pretty much every of my indicators and for each of these indicators i have to store all the orderflow data for each bar on the chart.
    It would be sooo much more efficient to have these data where they belong - at the bar series itself, once.

    Thank you,
    Mike

    #2
    Hello Mike,

    This would be outside of what is supported by NinjaTrader Support.

    However, it may be possible and this thread will remain open for any community members that would like to assist.

    Below I am providing a public link to the help guide on VolumetricBars that may give you pointers about what would need to be recreated in the custom bar type.
    https://ninjatrader.com/support/help...tric_bars2.htm


    You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like our business development follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Dear Chelsea,

      thank you for your answer.
      The question in general is, if it would be possible to create or fill a public Series<T> from the BarsType class which then would be publicly accessible from an Indicator. on the same chart.
      I am currently thinking about serializing a JSON object for each bar generated in the BarsType and store it in a database or text-file but i guess there has to be a better way.

      Another idea would be to use an Addon to create an empty "public" Ladder object for each open NTWindow and then to try access and fill/update this object from the BarsType class while the bars are created. But i really have no idea if this would even be possible in terms of accessability across the platform and scripts.

      Would be great if somebody came up with another approach.

      Thank you,
      Mike
      Last edited by mk77ch; 02-11-2019, 02:06 AM.

      Comment


        #4
        Dear NinjaTrader_ChelseaB,

        i figured out how to add additional information into a custom bartype and how to retrieve this data from an indicator based on the existing concept shown at the link you provided.

        So i add a List<> with a custom Object to the bartype script itself which contains all the information i later need.
        By casting the bartype like the volumetric bars

        Code:
        NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType barsType = Bars.BarsSeries.BarsType as     
        NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsType;
        i am then able to access this custom list of objects.
        The problem i am now running into is that the bartype can no longer be serialized e.g. saved because it includes my custom List<>.

        Is there a way to solve this problem with kind of a custom serializer?
        Currently i am just using [XmlIgnore()] before defining my List<> but this doesn't seem to be the best solution.

        I remember coming around serialization with custom drawing tools but i dont have any idea how to do this in a bartype.
        A little help would be very welcome

        Thank you,
        Mike

        Comment


          #5
          Hello Mike,

          If you are looking to perform some serialization on your list you could do so by creating a serializable property and then changing that property's getter and setter to update your list from serializable types and to convert the list to serializable types. This is how we handle brushes so they can be serialized.

          As for Series objects in a BarsType, we could not offer much further direction here since Series are designed to be synchronized against a Bars object when NinjaScripts have the Bars already available in State.DataLoaded. Since this would be done from a BarsType instead, we could not suggest a place to create the Series object.

          The amount of direction we can offer is limited as this reaches outside of what we would support with NinjaScript, but if you have any other NinjaScript related inquiries and would like to open a new thread, my colleagues and I will be happy to assist you further.
          JimNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by pstrusi, Today, 09:06 AM
          0 responses
          4 views
          0 likes
          Last Post pstrusi
          by pstrusi
           
          Started by vpzdcv, Today, 02:31 AM
          0 responses
          9 views
          0 likes
          Last Post vpzdcv
          by vpzdcv
           
          Started by YevhenShynkarenko, Today, 01:22 AM
          1 response
          20 views
          0 likes
          Last Post YevhenShynkarenko  
          Started by ttodua, Today, 12:52 AM
          0 responses
          8 views
          0 likes
          Last Post ttodua
          by ttodua
           
          Started by ttodua, Today, 12:50 AM
          0 responses
          8 views
          0 likes
          Last Post ttodua
          by ttodua
           
          Working...
          X