• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

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 Audiofail, Today, 05:40 AM
              6 responses
              18 views
              0 likes
              Last Post willwin
              by willwin
               
              Started by jerblaster23, Today, 03:42 PM
              1 response
              12 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by brian meade, Today, 01:39 PM
              2 responses
              10 views
              0 likes
              Last Post brian meade  
              Started by Johnny Santiago, Today, 12:20 PM
              1 response
              5 views
              0 likes
              Last Post NinjaTrader_ChrisL  
              Started by NinjaTrader_Brandon, Today, 10:24 AM
              0 responses
              69 views
              0 likes
              Last Post NinjaTrader_Brandon  
              Working...
              X