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

Bid and ask size

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

    Bid and ask size

    I would like to plot bid/ask size into the chart.
    I downloaded two indicators, one to plot the bid size, one ask size.
    Unfortunately it has a few issues: (1) no historical bid/ask size couldn't be plotted. (2) The values couldn't update in real time, i.e. the values couldn't update as long as the bid/ask size changes.

    The problem seems to lie on the code because it uses OnBarUpdate() which is wrong for such kinds of data. The ask size code:
    Code:
            protected override void OnBarUpdate()
            {
                if (Historical)
                    return;
                
                AskSize0.Set(GetCurrentAskVolume());
            }
    
            #region Properties
            [Browsable(false)]    // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
            [XmlIgnore()]        // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
            public DataSeries AskSize0
            {
                get { return Values[0]; }
            }
    
            #endregion
    The indicator should use "OnMarketData()".

    I believe it only takes one line or two to achieve it but I have nearly zero programming knowledge. I tried to guess "the right code" for several days but failed miserably.

    What should I change in order to use "OnMarketData()"?
    Could anyone kindly tell me?
    Thanks a lot.
    Attached Files

    #2
    Hi Profitmake,

    I see you have already discussed this request on another thread.


    Unfortunately, we cannot custom code this for you.
    TimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Pattontje, Yesterday, 02:10 PM
    2 responses
    14 views
    0 likes
    Last Post Pattontje  
    Started by flybuzz, 04-21-2024, 04:07 PM
    17 responses
    229 views
    0 likes
    Last Post TradingLoss  
    Started by agclub, 04-21-2024, 08:57 PM
    3 responses
    17 views
    0 likes
    Last Post TradingLoss  
    Started by TradingLoss, 04-21-2024, 04:32 PM
    4 responses
    43 views
    2 likes
    Last Post TradingLoss  
    Started by cre8able, 04-17-2024, 04:16 PM
    6 responses
    56 views
    0 likes
    Last Post cre8able  
    Working...
    X