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

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.



    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, 03: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 jclose, Today, 09:37 PM
          0 responses
          4 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,413 views
          0 likes
          Last Post Traderontheroad  
          Started by firefoxforum12, Today, 08:53 PM
          0 responses
          10 views
          0 likes
          Last Post firefoxforum12  
          Started by stafe, Today, 08:34 PM
          0 responses
          10 views
          0 likes
          Last Post stafe
          by stafe
           
          Started by sastrades, 01-31-2024, 10:19 PM
          11 responses
          169 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X