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

sum indicator

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

    sum indicator

    Hi,

    Anyone know how make the indicator Sum volume instead of price?


    Value[0] = Input[0] + (CurrentBar > 0 ? Value[1] : 0) - (CurrentBar >= Period ? Input[Period] : 0)

    What can i replace to get volume?

    TY

    #2
    Hello frankduc,

    Because the SUM indicator used Input in its syntax you can just pass the volume series into the SUM as an input:

    Code:
    double summed = SUM(Volume, 12)[0];


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Sorry i dont get it at all.

      Where do i input that code?

      Above this
      Value[0] = Input[0] + (CurrentBar > 0 ? Value[1] : 0) - (CurrentBar >= Period ? Input[Period] : 0)

      Comment


        #4
        Hello frankduc,

        The syntax that I had provided you would put in your script, wherever you want the SUM value for the Volume Series.

        If you just wanted to calculate the SUM for Volume, you just have to pass it the series and would not need to edit the SUM indicator at all.

        If you want to make a SUM indicator that always uses volume, you can make a copy of SUM and then replace the Input syntax with Volume everywhere you find it.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          I did what you said and it compile but i cant find the new indicator in the list when i double click indicator on the chart.

          Comment


            #6
            Hello frankduc,

            It should be listed as whatever you named the indicator when you created it.

            What steps did you follow to create the new indicator?

            You can find the Name = "" line in the file as well, and edit that to the name you want the indicator to have.

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              I give up

              Thanks for the help

              programming suck

              Comment


                #8
                Originally posted by frankduc View Post
                I give up

                Thanks for the help

                programming suck
                Frank,

                Don't give up. Attached is the VolumeSum indicator as you want.
                Easier than you think. All I did, changed "Input" to "Volume" and here you have it.

                Cheers!
                Attached Files

                Comment


                  #9
                  Thanks Aligator that is very nice of you. I dont have patience with programming.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Aviram Y, Today, 05:29 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post Aviram Y  
                  Started by quantismo, 04-17-2024, 05:13 PM
                  3 responses
                  25 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by ScottWalsh, 04-16-2024, 04:29 PM
                  7 responses
                  34 views
                  0 likes
                  Last Post NinjaTrader_Gaby  
                  Started by cls71, Today, 04:45 AM
                  0 responses
                  6 views
                  0 likes
                  Last Post cls71
                  by cls71
                   
                  Started by mjairg, 07-20-2023, 11:57 PM
                  3 responses
                  217 views
                  1 like
                  Last Post PaulMohn  
                  Working...
                  X