Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

TotalVolume -> Price Strategy

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

    TotalVolume -> Price Strategy

    Hi there,

    I want to switch from ATAS Platform to NinjaTrader. Therefore I would like to know / test whether my strategies can be implemented in Ninjatrader. I would have 2 questions:

    how can I get the total volume of a Candle / Range ?
    So I want to see what the volume was after the candle was finished. Only the total volume

    And how can I save the price and the respective volume at the price?? So he should add the volume to the respective price until the end of the loop and save it.
    Example: If I choose 5 minutes (loop), the respective volume is added to the corresponding price for 5 minutes

    Thanks a lot!

    #2
    Hello Burak,

    Thank you for your inquiry.

    If you'd just like to see the total volume for each candle on your chart, you can use the VOL indicator that comes built into NInjaTrader. When run using Calculate method OnBarClose, this will report the total volume at the end of each bar.

    In a NinjaScript, you can get the current volume for a bar by using Volume[int barsAgo] where int barsAgo is how many bars back from the current bar you wish to get volume information for. Using 0 there will give you the Volume for the current bar.

    I'm uncertain what you mean by the second example. Would you be able to provide further details of the desired behavior?

    Thanks in advance; I look forward to assisting you further.

    Comment


      #3
      Hello,
      I wrote the following code to test it. But I get multiple values ​​instead of just the total volume
      ( I only loaded one day)

      What have I done wrong ?
      Last edited by Burak; 02-03-2020, 02:37 PM.

      Comment


        #4

        For the second question:
        I'm uncertain what you mean by the second example. Would you be able to provide further details of the desired behavior?
        It should save the total volume at the respective price after each completed range candle (for 5 minutes) . Example picture in the appendix<

        Comment


          #5
          Hello Burak,

          Thank you for your reply.

          What interval are you using for your chart bars?

          Are you running this On Each Tick, On Price Change or On Bar Close? If you want the total for each bar to print, you would need to run this On Bar Close.

          Thanks in advance; I look forward to assisting you further.

          Comment


            #6
            It`s OnBarClose , Unfortunately, it still doesn't work

            Comment


              #7
              I quickly rewritten the code. It works now . Can you maybe help me with the second question?

              Comment


                #8
                Hello Burak,

                Thank you for your second reply.

                This would be more complicated if you're looking to essentially get volume information for each price level.

                Here's an example from our help guide you could check out and modify to fit your needs:



                Please let us know if we may be of further assistance to you.



                Comment


                  #9
                  Unfortunately, the site does not help me. I just want to save / add the price and volume after each completed range bar / candle. It's also more about how I can best save it.

                  Comment


                    #10
                    Hello Burak,

                    Thank you for your reply.

                    The example given in my previous post would be essentially what you would need to access the data for each price. It would be up to you to save that data and manipulate it as you see fit. To save the values for later use, you can assign them to a variable.

                    Just to be clear, in platform support, we do not create/write scripts for clients, we do not provide debugging services. We also cannot provide programming education services. If you would like the script created for you , we can provide references to 3rd party programmers who could meet your needs.

                    If you would like, I can provide resources for learning NinjaScript as well.

                    Please let us know if we may be of further assistance.

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by NullPointStrategies, Today, 05:17 AM
                    0 responses
                    38 views
                    0 likes
                    Last Post NullPointStrategies  
                    Started by argusthome, 03-08-2026, 10:06 AM
                    0 responses
                    124 views
                    0 likes
                    Last Post argusthome  
                    Started by NabilKhattabi, 03-06-2026, 11:18 AM
                    0 responses
                    64 views
                    0 likes
                    Last Post NabilKhattabi  
                    Started by Deep42, 03-06-2026, 12:28 AM
                    0 responses
                    41 views
                    0 likes
                    Last Post Deep42
                    by Deep42
                     
                    Started by TheRealMorford, 03-05-2026, 06:15 PM
                    0 responses
                    46 views
                    0 likes
                    Last Post TheRealMorford  
                    Working...
                    X