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

bettervolume3 on bar close false issue

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

    bettervolume3 on bar close false issue

    Trying to find out how to correct issue with this indicator. If you calculate on bar close to false the colors are not always correct when the bar closes. Example as in live bars are on say half the day, then you change to calculate of bar closes to true, a lot of bars change colors meaning something is not calculating correctly. Anybody else see this issue and how do I fix. I want the live color bars while the candle is forming but you can not trust that it is correct. Thanks

    #2
    Hello pdcarpen,

    Have you createad a script that is being applied to a chart that is setting BarColor?


    Have you added prints to your script to see on what bars the conditions are true and when the color is being set?

    Below is a link to a forum post that discusses using prints to understand behavior.


    If so, please include the output from the prints so that we may assist in analyzing information in the prints.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      I downloaded bettervolume3 from the indicator forum on ninja. I have not changed anything or any codes. It says it corrected the on close function for nt7 but not seeing that to be the case. Not a coder so just would like to download it if I could. I will post pictures first is live color candles and second is after i refresh. Seem to work just fine on print on close of bar but does not work on false option.
      1st photo is live color bars 2nd is after refresh. just from the circle to the right.
      Attached Files
      Last edited by pdcarpen; 07-19-2017, 09:04 AM. Reason: added photos

      Comment


        #4
        /*

        Modified: Oct 14 2010
        Modification: added logic to reset the Plots when the CalculateOnBarClose=false;
        previously the bars would not paint correctly.
        enjoy


        Barry Taylor's Better Volume Indicator as described at

        Coded for NinjaTrader by Alex Matulich, 2009-10-08, Unicorn Research Corporation.
        This indicator optionally uses True Range rather than Range, it plots an exponential
        moving average of the volume instead of simple moving average for efficiency,
        and it optionally paints the price bars when BetterVolume2 indicates something
        other than the normal color.

        Watch for these at different stages of the market:

        | Bottom | Start |Continue| Top | Start |Continue
        | |uptrend|uptrend | |downtrend|downtrend
        ------------------+--------+-------+--------+--------+---------+---------
        Volume Climax Up | | Yes | | Yes | | Yes red
        Volume Climax Down| Yes | | Yes | | Yes | white/black
        High Volume Churn | Yes | | | Yes | | green/blue
        Climax + Hi Churn | Yes | | | Yes | | magenta
        Low Volume | Yes | | Yes | Yes | | Yes yellow
        -------------------------------------------------------------------------

        This indicator works the same on daily or intraday bars. The original Tradestaion
        code makes use of up volume and down volume data for intraday bars, and for daily
        bars it calculates up volume and down volume from the relative positions of open,
        high, low, and close. We use the latter method here, because NinjaTrader does not
        provide up volume and down volume data.
        */


        But seem still not to work correctly

        Comment


          #5
          Hello pdcarpen,

          If you are using an indicator that was created by 3rd party and posted on the NinjaTrader forum (however, you linked a different website and not the NinjaTrader forum), and you wanting the script corrected, you need to contact the vendor or author that creates the script for assistance with its use, to report any issues with the script, or to ask for modifications.

          If you are trying to correct this indicator yourself, you would need to debug the script by adding prints to understand the behavior.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            This was download from ninja forum indicators.. on the website. says ninja support staff helped with the fix was trying to find out what was fixed? As it is not fixed or am I missing something. The link to the forum for the indicator:
            called bettervolume3



            This is exactly the same as BetterVolume2 with a minor change to accomodate NT Version 7.
            I take not credit for originality just corrected it to work in NT 7 when CalculateOnBarClose= false;
            Also credit to Bretrand and other Ninja support staff for pointing me in the correct direction to fix this.

            Any help would be great. Thank you

            Comment


              #7
              Hello pdcarpen,

              Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify code or logic for our clients. This is so that we can maintain a high level of service for all of our clients as well as our partners.

              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.

              If you are wanting to correct this script yourself, you would need to add prints to the script to understand the behavior so that changes can be made.

              First, find the condition that is calling BarColor.
              Then outside of that condition add a print with the time of the bar that prints all variables used in that condition.
              Then include the output from the output window with your next post, and I can assist you in understanding the information.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                This is what I found in the code but really do not know what I am looking at. Thanks for the help so far.

                // bc = bar color = index number of plot created in Initialize()

                bool sameday = eod ? true : (Time[0].Day == Time[1].Day);
                int bc = 0; // default 0 (normal volume bar)
                if (cond1 || (cond11 && sameday)) bc = 1; //LowVol
                if (cond2 || cond3 || cond8 || cond9 || ((cond12 || cond13 || cond18 || cond19) && sameday)) bc = 2; //ClimaxUp
                if (cond4 || cond5 || cond6 || cond7 || ((cond14 || cond15 || cond16 || cond17) && sameday)) bc = 3; //ClimaxDown
                if (cond10 || (cond20 && sameday)) bc = 4; //Churn
                if (bc == 4 && (cond2 || cond3 || cond4 || cond5 || cond6 || cond7 || cond8 || cond9 || (cond12 || cond13 || cond14 || cond15 || cond16 || cond17 || cond18 || cond19) && sameday))
                bc = 5; //ClimaxChurn

                // plot stuff
                Values[bc].Set(Volume[0]); //draw the volume bar we found
                if (paintbars && bc > 0) BarColor = Plots[bc].Pen.Color; // paint the price bar

                VolEMA.Set(vwt * (Volume[0] - VolEMA[1]) + VolEMA[1]); // plot average; faster than SMA

                Comment


                  #9
                  Hello pdcarpen,

                  There does appear to be a line of code that sets the BarColor.

                  if (paintbars && bc > 0) BarColor = Plots[bc].Pen.Color;

                  If you print the values, are these having unexpected values at unexpected times?

                  Print(string.Format("{0} | paintbars: {1} == true & bc: {2} > 0", Time[0], paintbars, bc));

                  What is the output you get from this print?
                  On which bar are you getting an unexpected color?
                  Chelsea B.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by GwFutures1988, Today, 02:48 PM
                  0 responses
                  2 views
                  0 likes
                  Last Post GwFutures1988  
                  Started by mmenigma, Today, 02:22 PM
                  1 response
                  3 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by frankthearm, Today, 09:08 AM
                  9 responses
                  35 views
                  0 likes
                  Last Post NinjaTrader_Clayton  
                  Started by NRITV, Today, 01:15 PM
                  2 responses
                  9 views
                  0 likes
                  Last Post NRITV
                  by NRITV
                   
                  Started by maybeimnotrader, Yesterday, 05:46 PM
                  5 responses
                  28 views
                  0 likes
                  Last Post NinjaTrader_ChelseaB  
                  Working...
                  X