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

set plots to drawtext

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

  • NinjaTrader_CodyB
    replied
    Hello,
    The code provided should process exactly as you are wanting.
    Can you clarify that you are indeed wanting the Bid volume and the Ask Volume and not the traded Volume of the Bar?
    Also so I may test further please clarify what instrument you are testing this on.

    Leave a comment:


  • imalil
    replied
    Thanks for this info, Cody. It is giving me a volume result, but it's incorrect. I'm using a 19 tick bar chart for testing and I'm getting volume of around 600, when it should actually be 20 to 40.

    My ind is working, at least to the output window, I'm just getting an incorrect volume result.

    Again, I only want bid+ask volume on the current tick bar then cleared for the next bar.

    Any thoughts as to what's going wrong?
    Thanks.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    Harry is correct in that you can store these values in NinjaTrader 8.
    If you wanted to use NinjaTrader 7 you can add two data series: one for the bid and another for the ask.
    Then create a plot that is set to the Volume of the added data series.
    Please see the example below:
    Code:
    protected override void Initialize()
    {
         Add("ES 03-16", PeriodType.Tick, 150, MarketDataType.Ask);
         Add("ES 03-16" , PeriodType.Tick, 150, MarketDataType.Bid);
         Add(new Plot(Color.FromKnownColor(KnownColor.RoyalBlue), PlotStyle.Bar,   "BidandAskVol"));
         Overlay= true;
         CalculateOnBarClose = false;
    }
    protected override void OnBarUpdate()
    {
          BidandAskVol.Set(VOL(BarsArray[1])[0] + VOL(BarsArray[2])[0]);
    }
    Please see the following link on working with multiple time-frames and instruments: http://ninjatrader.com/support/helpG...nstruments.htm

    Please let me know if you have any questions on the example.

    Leave a comment:


  • Harry
    replied
    You should switch to NinjaTrader 8, as it offers to store synchronized bid and ask volume in the historical data base.

    Leave a comment:


  • imalil
    replied
    I simply want to get the bid and ask volume for each tick bar so I can use it in a calculation for each bar. Then I want the results to be able to stay in a panel on my charts, not disappear when the chart refreshes. If this is what you mean by historical, then I guess I want historical.

    Thanks.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    There is not a method that would return this value however through custom logic it would be possible.

    Are you trying to get the historical volume or only the realtime volume bid plus ask volume?

    Leave a comment:


  • imalil
    replied
    I've been looking at the MACD ind and it's helping me understand datasets and plots a little more, so I'll be studying that for a while. I have another question:

    In OnBarUpdate using tick bars, I want to calculate the total volume of the bar, bidvol + askvol, then zero it out when the bar closes, and do the same for the next bar. I need this result to use in a calculation. I thought askVol + bidVol would work, but it returns a zero every time.

    Is there a function that will return bidvol and askvol of each bar?

    Thank you.

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    The plot is what will hold the values of the level 2 data and then the DrawText() would be a visual representation of this data. You would not be assigning a plot to the DrawText but instead you will be creating DrawText() methods based off of the plots dataset.
    Are you trying to recreate the order flow analytics indicators or can you clarify further what you are trying to achieve?

    Leave a comment:


  • imalil
    replied
    I'm not sure what you mean. My ind runs a calculation and creates results from the order flow of each bar. So it's level 2 I believe. I'm told I need a plot for each result--which is a number that prints via drawtext on my chart--so a strategy can reference these plots.

    Does this help your understanding?
    Thanks,
    Chris

    Leave a comment:


  • NinjaTrader_CodyB
    replied
    Hello,
    Can you clarify what part of the text object are you wanting to assign the plot to?
    For example are you wanting to assign the plot to the Y value of the DrawText() object?

    Leave a comment:


  • imalil
    started a topic set plots to drawtext

    set plots to drawtext

    I made an indicator that is working very well, but I do not understand plots to eventually use a strategy.

    I want to assign variables to my drawtext print statements, then I want to set my plots to these variables.

    If you could point me in the right direction I'd really appreciate it.

    Thank you.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Skifree, Today, 11:21 AM
2 responses
9 views
0 likes
Last Post Skifree
by Skifree
 
Started by manueldecastro, Today, 01:16 PM
3 responses
11 views
0 likes
Last Post NinjaTrader_BrandonH  
Started by tradingnasdaqprueba, Today, 03:42 AM
9 responses
35 views
0 likes
Last Post NinjaTrader_Jesse  
Started by llanqui, Yesterday, 03:51 PM
6 responses
27 views
0 likes
Last Post NinjaTrader_Gaby  
Started by AlgoDreamer, Today, 12:39 PM
2 responses
9 views
0 likes
Last Post AlgoDreamer  
Working...
X