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

Plot Bid Ask volumes on chart

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

    Plot Bid Ask volumes on chart

    Hello,
    how can I plot

    e.MarketDepth.Bid[0].Volume;

    on my Chart?

    #2
    Hello,
    You could plot this value by creating a Plot and then setting the Plot in OnMarketDepth() to e.MarketDepth.Bid.[0].Volume

    For example:
    Code:
    protected override void Initialize()
    {
        Add(new Plot(Color.FromKnownColor(KnownColor.Orange), PlotStyle.Line, "Plot0"));
    }
    protected override void OnMarketDepth(MarketDepthEventArgs e)
    {
        Plot0.Set(e.MarketDepth.Bid[0].Volume);
    }
    For more information on Plots please see the following link: http://ninjatrader.com/support/helpGuides/nt7/plots.htm

    If we can be of any other assistance please let us know.
    Cody B.NinjaTrader Customer Service

    Comment


      #3
      Thanks for your reply.

      What if I want to use DrawText?

      Parameters:

      string text = e.MarketDepth.Bid[0].Volume
      double y = Bid value

      thanks for your help

      Comment


        #4
        Hello,
        You could create a DrawText() object that uses the e.MarketDepth.Bid[0].Volume by setting a double to the bid volume in OnMarketDepth() and then in OnBarUpdate() use the DrawText() to have it use the variable.
        For example:
        Code:
        private double bidVolume = 0.0;
        
        protected override void OnBarUpdate()
        { 
             DrawText("bid volume" , "e.MarketDepth.Bid[0].Volume " + bidVolume, 0, bidVolume, Color.Black); 
        }
        protected override void OnMarketDepth(MarketDepthEventArgs e)
        {
        	bidVolume = e.MarketDepth.Bid[0].Volume;
        }
        If you have the DrawText() object plot at the y value of bidVolume variable like my example does it is important to understand that if the chart is showing a price such as 1000 and the volume is say 100 then you would need to scroll down to 100 to see the text object or you can turn on autoscale which would shrink the the chart.
        Please see the following link on the DrawText() method: http://ninjatrader.com/support/helpG...7/drawtext.htm
        Cody B.NinjaTrader Customer Service

        Comment


          #5
          Hello CodyB,
          Thanks for your help but unfortunately it's not what I'm looking for

          I think it's the fault of my English, sorry about that


          I am trying to print the first level of bid and ask on my chart

          Please view the image





          Not in OnBarUpdate() but in real time as SuperDom upgrade
          The level of y is dynamic, corresponds to the levels of bid and ask prices

          Cheers

          Comment


            #6
            Hello,
            You could have the DrawText() method in the OnMarketDepth() method event then.

            There is an indicator on the forum that plots the levels of market depth on the chart that you may you could use as a reference. This indicator can be found at the following link: http://ninjatrader.com/support/forum...hp?&linkid=339

            To Import

            Download the NinjaScripts to your desktop, keep them in the compressed .zip file.

            From the Control Center window select the menu File> Utilities> Import NinjaScript

            Select the downloaded .zip file

            NinjaTrader will then confirm if the import has been successful.

            Critical - Specifically for some NinjaScripts, it will prompt that you are running newer versions of @SMA, @EMA, etc. and ask if you want to replace, press 'No'

            Once installed, you may add the indicator to a chart by:

            Right click you chart > indicators > Select the Indicator from the list on the left > New > OK
            If we can be of any other assistance please let us know.
            Cody B.NinjaTrader Customer Service

            Comment


              #7
              Thank you. I am going to try this indicator.

              Best

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by Waxavi, Today, 02:00 AM
              0 responses
              2 views
              0 likes
              Last Post Waxavi
              by Waxavi
               
              Started by elirion, Today, 01:36 AM
              0 responses
              3 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by gentlebenthebear, Today, 01:30 AM
              0 responses
              4 views
              0 likes
              Last Post gentlebenthebear  
              Started by samish18, Yesterday, 08:31 AM
              2 responses
              9 views
              0 likes
              Last Post elirion
              by elirion
               
              Started by Mestor, 03-10-2023, 01:50 AM
              16 responses
              391 views
              0 likes
              Last Post z.franck  
              Working...
              X