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

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.
    Paul H.NinjaTrader Customer Service

    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?
        Paul H.NinjaTrader Customer Service

        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?
            Paul H.NinjaTrader Customer Service

            Comment


              #7
              Hi paul,

              Thanks for meaningful insights.

              I am using true data financial service pvt ltd datafeed.

              Truedata is the best real-time data vendor in India. Get historical data for NSE, MCX, and tick data for Amibroker and Ninja Trader. Best Indian Real-time NSE Authorized Data Provider.


              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.
                  Paul H.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by chbruno, Today, 04:10 PM
                  0 responses
                  3 views
                  0 likes
                  Last Post chbruno
                  by chbruno
                   
                  Started by josh18955, 03-25-2023, 11:16 AM
                  6 responses
                  436 views
                  0 likes
                  Last Post Delerium  
                  Started by FAQtrader, Today, 03:35 PM
                  0 responses
                  6 views
                  0 likes
                  Last Post FAQtrader  
                  Started by rocketman7, Today, 09:41 AM
                  5 responses
                  19 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by frslvr, 04-11-2024, 07:26 AM
                  9 responses
                  127 views
                  1 like
                  Last Post caryc123  
                  Working...
                  X