Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

coding help

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

    coding help

    Hi members,

    kindly help me with coding of below logic.
    the logic is at any point if the volume is high than simply take volume and mark it.

    but during live market i am getting high volumes than actual volumes once i reload the chart it is again showing actual volumes.

    kindly help me in fixing the bug, i have posted the complete code below.

    Thanks and Regards,
    Metal15


    protected override void OnStateChange()
    {
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "UMove1";
    Calculate = Calculate.OnBarClose;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = false;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = false;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    Tvalue = 0;

    AddPlot(new Stroke(Brushes.LimeGreen, 1), PlotStyle.Bar, "Dvol");
    AddPlot(new Stroke(Brushes.Red, 1), PlotStyle.Bar, "Drol");
    AddPlot(new Stroke(Brushes.Blue, 1), PlotStyle.Bar, "Dvvol");
    AddPlot(new Stroke(Brushes.Yellow, 1), PlotStyle.Bar, "Drrol");
    }
    else if (State == State.Configure)
    {
    }
    }

    protected override void OnBarUpdate()
    {
    //Add your custom indicator logic here.

    if( CurrentBar < 1 )return;
    double curC =Close[0];
    double curP = Close[1];

    double curV = Volume[0];



    Tvalue=SMA(volume,5)[0];

    if ((curV*curC )> (3*Tvalue) )
    {
    if(curC> curP)
    {
    Dvvol[0]=(curV*curC)/10000000;

    }
    else if(curC<=curP)
    {

    Drrol[0]=(curV*curC)/10000000;


    }

    }
    else if ((curV*curC )> Tvalue )
    {
    if(curC> curP)
    {
    Dvol[0]=(curV*curC)/10000000;

    }
    else if(curC<=curP)
    {

    Drol[0]=(curV*curC)/10000000;


    }

    }
    }

    #2
    Hello Metal15,

    Thanks for your post.

    What instrument and bar type are you testing this on? Can you post before and after screenshots that illustrate the issue you are seeing?

    In terms of your code, not sure if it is a typo but in this line: Tvalue=SMA(volume,5)[0]; volume should be Volume.

    Comment


      #3
      hi paul

      i am using on indian stocks, and using candle sticks charts.

      Thanks and Regards,
      Metal15

      Comment


        #4
        Hello Metal15,

        Thanks for your reply.

        Can you post a couple of screenshots that show your chart before refresh and after refresh?

        Comment


          #5
          charts

          Hi paul,

          In first chart you can see volume is very high and once i click on load historical data,
          the volume adjusts.
          file named 5 is before reloading data, file 6 is after reloading data.

          kindly fix this bug.

          Thanks and Regards,
          Metal15.
          Attached Files

          Comment


            #6
            Hello Metal15,

            Thanks for your reply.

            It may be the data provided by your data provider

            Please add the VOL indicator to your charts and perform the same reload process, do you see the VOL value changed as well?

            Who is your data provider?

            Comment


              #7
              Hi paul,

              Thanks for meaningful insights.

              I am using true data financial service pvt ltd datafeed.

              TrueData is the best authorized real-time market data vendor. Get low latency feeds for NSE, MCX, and tick data, tailored for successful algo trading.


              can check more info about them.
              will check in monday live market and post screenshots.

              Thanks and Regards,
              Metal15

              Comment


                #8
                Hi paul,


                I have spoke to data vendor, they are saying its a ninja trader bug.

                today morning I have loaded volume indicator can clearly see there is diff in volumes before and after refreshing.

                I have attached charts with volume indicator.

                What should i do now, want to file a complaint against data vendor in consumer court.


                Thanks and Regards,
                Metal15.
                Attached Files

                Comment


                  #9
                  Hello Metal15,

                  Thanks for your reply.

                  We would like you to try this process:

                  1) With Ninjatrader shutdown
                  2) Using windows explorer, navigate to Documents>NinjaTrader8>db>Cache - delete all files in cache folder
                  3) Next delete the contents of the folders: db>tick db>Minute and db>day
                  4) Restart NinjaTrader
                  5) Connect to your data feed and after data has loaded, retest for the issue (just use the VOL indicator).

                  In addition, please post a screenshot of your settings in Tools>options>Market data properties.

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  573 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  331 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  101 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  549 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  550 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X