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

Accessing Volumetric Data

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

    Accessing Volumetric Data

    As a NOOB, I was happy to be able to modify "Tasker-182"s VolumetricData indicator to show DeltaSh "Delta Since High" & DeltaSl "Delta Since Low".
    The last thing I needed is to modify the indicator to hold an accessable value called "DeltaStr" derived from ((DeltaSh + DeltaSl) / Volume) * 100.
    I've tried many ways after looking at strucure on many indicators code but not being a coder and not understanding "why what goes where", I'm stumped.
    Seems like it should be quite simple.
    Any help would be appreciated.
    Thank you in advance...

    #2
    Hello Randwulf,

    Thank you for your post.

    What have you tried so far and what were the results? Were you able to compile or did you get error messages after trying to add in DeltaStr? Is the issue with the value being accessible? We do have a reference sample that demonstrates the concept of exposing indicator values that are not plots here:


    Please provide additional clarification so I may more accurately assist you. I look forward to your reply.
    Emily C.NinjaTrader Customer Service

    Comment


      #3
      Thx 4 the reply.
      I've attached the indicator.
      I modified Lines 80-81, 123-124, 148-149 & 309-321.
      I just need help getting started on how and where to insert an accessable double "DeltaStr"
      so that I can connect it with a formula ((DeltaSh + DeltaSl) / Volume) * 100. VolumetricData_RO2.cs

      Comment


        #4
        Hello Randwulf,

        Thank you for your reply.

        It looks like this indicator creates statistics as plots so they show in the data box. I still don't know exactly what you mean as "accessable double" but if you want the value for DeltaStr to be shown in the data box, you would need to call AddPlot() in the same way that you did for DeltaSh and DeltaSl. You would likely need to use barsAgo indexes when making your calculation, so once the plot has been added it could look something like:
        DeltaStr[0] = ((DeltaSh[0] + DeltaSl[0] / Volume) * 100);

        For more details on AddPlot(), please see the following help guide page:


        When working with a series, you need to specify a barsAgo index to get the value of that series for a specific bar. Otherwise, if you refer to just the series object overall, such as DeltaSh or DeltaSL, without a barsAgo index, a double value will not be returned. We have more details on Working with Price Series that covers this type of concept here:


        I hope this information is useful. Please let us know if we may be of further assistance.
        Emily C.NinjaTrader Customer Service

        Comment


          #5
          To your question;
          I need another indicator (BloodHound) to be able to access the variables' "DeltaStr" value
          as it processes DeltaStr[0] = ((DeltaSh[0] + DeltaSl[0] / Volume) * 100);
          Firstly, I haven't been able to create a new object "DeltaStr" to work with...
          If that's figured out, I can probably do the rest.

          Comment


            #6
            Hello Randwulf,

            Thank you for your reply.

            You should be able to create DeltaStr with AddPlot() if you want it to be a plot like the other values in the indicator. The AddPlot() page in the help guide has more details about how it is used, though there is also code that needs to be added to the "Properties" region at the bottom of the script when adding plots. It is typically best to add plots from the wizard when creating a new indicator so this code is auto-generated, though you could likely copy one of the other plot's properties and simply increment the Values[] index. Here is the AddPlot() page of the help guide:


            Otherwise, I suggest reviewing this reference sample "Exposing indicator values that are not plots" for more information on how to expose other values so they are available to other scripts:


            Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services or one on one educational support in our NinjaScript Support department. This is so that we can maintain a high level of service for all of our clients as well as our associates.

            That said, through email or on the forum we are happy to answer any questions you may have about NinjaScript if you decide to code this yourself. We are also happy to assist with finding resources in our help guide as well as simple examples, and we are happy to assist with guiding you through the debugging process to assist you with understanding unexpected behavior.

            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 NinjaTrader Ecosystem team to follow up with you with a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​

            Please let us know if we may be of further assistance.
            Emily C.NinjaTrader Customer Service

            Comment


              #7
              Thank you so much for your assistance Emily...
              Once I got:
              OnStateChange Section:
              AddPlot(Brushes.Transparent, "DeltaStr");
              OnBarUpdate Section:
              DeltaStr[0] = ((DeltaSh[0] + DeltaSl[0])/TotalVolume[0]*100);
              region Properites
              [Browsable(false)]
              [XmlIgnore]
              public Series<double> DeltaStr
              {
              get { return Values[23]; }
              }​
              it worked beautifully. Very satisfying for someone who knows next to nothing about C# for NinjaScript.
              Many thanks again for your guidance.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by llanqui, Today, 03:53 AM
              0 responses
              5 views
              0 likes
              Last Post llanqui
              by llanqui
               
              Started by burtoninlondon, Today, 12:38 AM
              0 responses
              10 views
              0 likes
              Last Post burtoninlondon  
              Started by AaronKoRn, Yesterday, 09:49 PM
              0 responses
              15 views
              0 likes
              Last Post AaronKoRn  
              Started by carnitron, Yesterday, 08:42 PM
              0 responses
              11 views
              0 likes
              Last Post carnitron  
              Started by strategist007, Yesterday, 07:51 PM
              0 responses
              14 views
              0 likes
              Last Post strategist007  
              Working...
              X