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

Simple Total FootPrint Bid x Ask

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

    Simple Total FootPrint Bid x Ask

    Dear friends...I'am new in NinjaTrader but I now C++ and Mql.
    I need to build a footprint that shows Total BIDxASK of the day.
    I think that it is not very complex but I don't know where begin. There is some basically opensource footprint to.do that? I saw Gomi indicator ecc but I would make.my custom footprint. (Quite Like this http://clip2net.com/s/5ShRS5 but more simple)
    Can someone help me?

    Many thanks to all

    http://clip2net.com/s/5ShRS5
    Last edited by ketron82; 10-05-2013, 04:12 AM.

    #2
    Can Someone help me?
    I am able to make simple indicator with ninja but I cannot found information or guide to program advanced indicator ....example a grid on the right of the Candle or a new window.
    Where do I can found information or example....?

    Many thanks again

    Comment


      #3
      Hello ketron82,

      We have a sample Indicator that builds a Level II book that you may use to help you build your Indicator at the following thread.



      Then you may use something like the DrawText() or Print() method to be able to print out the results.

      Happy to be of further assistance.
      JCNinjaTrader Customer Service

      Comment


        #4
        OK.....many many thanks....!
        I have dowloaded the 2 archive and I don't Know wich import...i think the ver. NT7 because I have this version http://clip2net.com/s/5TFFMv or no?

        So...when I go importing....I have this response:
        1) http://clip2net.com/s/5TFHcS
        2) If I click yes NT return me an error but If I click NO I obtain the correct response http://clip2net.com/s/5TFHr2
        3) When I load the indicator on chart I see nothing.... http://clip2net.com/s/5TFJSM and http://clip2net.com/s/5TFKxc

        How I made error?

        Also...I am reading the Code...and I will search to adapt It to my ideas
        Many Thanks

        Comment


          #5
          Originally posted by NinjaTrader_JC View Post
          Hello ketron82,

          We have a sample Indicator that builds a Level II book that you may use to help you build your Indicator at the following thread.



          Then you may use something like the DrawText() or Print() method to be able to print out the results.

          Happy to be of further assistance.
          Many thanks....I will study the code but on the graph I have a problem like described in the previous post...When I have understood something I will insert DrawText() or Print() to made some experiment.

          Comment


            #6
            Originally posted by ketron82 View Post
            3) When I load the indicator on chart I see nothing.... http://clip2net.com/s/5TFJSM and http://clip2net.com/s/5TFKxc

            How I made error?

            Also...I am reading the Code...and I will search to adapt It to my ideas
            Many Thanks
            I believe this will only work in market replay with level II data going forward, or in live market.

            Historical will probably not work.


            Yep - just opened up the indicator and I see the comments:

            Code:
                    protected override void OnBarUpdate()
                    {
            			// Since the L2 data is only stored on real-time bars, there is no need to print L2 books on historical data
                        if (Historical)
            				return;

            Comment


              #7
              Originally posted by sledge View Post
              I believe this will only work in market replay with level II data going forward, or in live market.

              Historical will probably not work.


              Yep - just opened up the indicator and I see the comments:

              Code:
                      protected override void OnBarUpdate()
                      {
              			// Since the L2 data is only stored on real-time bars, there is no need to print L2 books on historical data
                          if (Historical)
              				return;
              ok many thanks...so...30 min and I will test the indicator on Futures Open...!
              I think that I could test indicator with the simulator but today is Sunday and I have not had more time.

              Comment


                #8
                Nothing appear on Market Opened


                and this is the settings



                where is the error?

                TNX

                Comment


                  #9


                  Only the first indicator Run....mhmhmh?..

                  Comment


                    #10
                    Not on chart

                    I believe that sample indicator prints to the output window. Open one and see if it is working.

                    Dan
                    eDanny
                    NinjaTrader Ecosystem Vendor - Integrity Traders

                    Comment


                      #11
                      Ok....In the Output Window I see that


                      and is right ...or no?...i see the book level for ask and bid.!

                      Comment


                        #12
                        Originally posted by eDanny View Post
                        I believe that sample indicator prints to the output window. Open one and see if it is working.

                        Dan
                        yes...this morning I have saw that....all right...perfect.....now...i begin test about ask and bid volume for each price...and I would begin simply starting from ask volume.
                        I hope that I don't make disaster ahahah

                        Many many thanks

                        Comment


                          #13
                          I removed the condition for SMA and now....I would create a variable for example one single price and i would send the volume (traded) that pass in ASK. I searching the command for read it.



                          Code:
                           protected override void OnBarUpdate()
                                  {
                          			// Since the L2 data is only stored on real-time bars, there is no need to print L2 books on historical data
                                      if (Historical)
                          				return;
                          			
                          			// When the Close price crosses over the SMA, print the L2 books.
                          			
                          			//if (CrossAbove(Close, SMA(5), 1))
                          			//{
                          				// Prints the L2 Ask Book we created. Cycles through the whole List and prints the contained objects.
                          				Print("Ask Book");
                          				for (int idx = 0; idx < askRows.Count; idx++)
                          					Print("Ask Price=" + askRows[idx].Price + " Volume=" + askRows[idx].Volume + " Position=" + idx);
                          				
                          				// Prints the L2 Bid Book we created. Cycles through the whole List and prints the contained objects.
                          				Print("Bid Book");
                          				for (int idx = 0; idx < bidRows.Count; idx++)
                          					Print("Bid Price=" + bidRows[idx].Price + " Volume=" + bidRows[idx].Volume + " Position=" + idx);
                          			//}
                                  }

                          Comment


                            #14
                            I begin another indicator to test OnMarketData() but I cannot compile because I receive this error http://clip2net.com/s/5UoO7u


                            Code:
                            #region Using declarations
                            using System;
                            using System.ComponentModel;
                            using System.Diagnostics;
                            using System.Drawing;
                            using System.Drawing.Drawing2D;
                            using System.Xml.Serialization;
                            using NinjaTrader.Cbi;
                            using NinjaTrader.Data;
                            using NinjaTrader.Gui.Chart;
                            #endregion
                            
                            // This namespace holds all indicators and is required. Do not change it.
                            namespace NinjaTrader.Indicator
                            {
                                /// <summary>
                                /// Enter the description of your new custom indicator here
                                /// </summary>
                                [Description("Enter the description of your new custom indicator here")]
                                public class ASKBIDvol : Indicator
                                {
                                    #region Variables
                                    // Wizard generated variables
                                        private long askv = 0; // Default setting for Askv
                                        private long bidv = 0; // Default setting for Bidv
                                        private double price = 0; // Default setting for Price
                                    // User defined variables (add any user defined variables below)
                                    #endregion
                            
                                    /// <summary>
                                    /// This method is used to configure the indicator and is called once before any bar data is loaded.
                                    /// </summary>
                                    protected override void Initialize()
                                    {
                                        Overlay				= false;
                                    }
                            
                                    /// <summary>
                                    /// Called on each bar update event (incoming tick)
                                    /// </summary>
                                    protected override void OnBarUpdate()
                                    {
                                        // Use this method for calculating your indicator values. Assign a value to each
                                        // plot below by replacing 'Close[0]' with your own formula.
                                    }
                                  
                            		protected override void OnMarketData(MarketDataEventArgs e)
                                    		
                            	      {
                                
                              			  if (e.MarketDataType == MarketDataType.Last) 
                                     	  Print("Last = " + e.Price + " " + e.Volume);
                             
                                		  else if (e.MarketDataType == MarketDataType.Ask)
                                    	  Print("Ask = " + e.Price + " " + e.Volume);
                                	      else if (e.MarketDataType == MarketDataType.Bid)
                                     	  Print("Bid = " + e.Price + " " + e.Volume);
                            		  }
                             
                            		
                                    #region Properties
                            
                                    [Description("")]
                                    [GridCategory("Parameters")]
                                    public int Askv
                                    {
                                        get { return askv; }
                                        set { askv = Math.Max(0, value); }
                                    }
                            
                                    [Description("")]
                                    [GridCategory("Parameters")]
                                    public int Bidv
                                    {
                                        get { return bidv; }
                                        set { bidv = Math.Max(0, value); }
                                    }
                            
                                    [Description("")]
                                    [GridCategory("Parameters")]
                                    public int Price
                                    {
                                        get { return price; }
                                        set { price = Math.Max(0, value); }
                                    }
                                    #endregion
                                }
                            }
                            
                            #region NinjaScript generated code. Neither change nor remove.
                            // This namespace holds all indicators and is required. Do not change it.
                            namespace NinjaTrader.Indicator
                            {
                                public partial class Indicator : IndicatorBase
                                {
                                    private ASKBIDvol[] cacheASKBIDvol = null;
                            
                                    private static ASKBIDvol checkASKBIDvol = new ASKBIDvol();
                            
                                    /// <summary>
                                    /// Enter the description of your new custom indicator here
                                    /// </summary>
                                    /// <returns></returns>
                                    public ASKBIDvol ASKBIDvol(int askv, int bidv, int price)
                                    {
                                        return ASKBIDvol(Input, askv, bidv, price);
                                    }
                            
                                    /// <summary>
                                    /// Enter the description of your new custom indicator here
                                    /// </summary>
                                    /// <returns></returns>
                                    public ASKBIDvol ASKBIDvol(Data.IDataSeries input, int askv, int bidv, int price)
                                    {
                                        if (cacheASKBIDvol != null)
                                            for (int idx = 0; idx < cacheASKBIDvol.Length; idx++)
                                                if (cacheASKBIDvol[idx].Askv == askv && cacheASKBIDvol[idx].Bidv == bidv && cacheASKBIDvol[idx].Price == price && cacheASKBIDvol[idx].EqualsInput(input))
                                                    return cacheASKBIDvol[idx];
                            
                                        lock (checkASKBIDvol)
                                        {
                                            checkASKBIDvol.Askv = askv;
                                            askv = checkASKBIDvol.Askv;
                                            checkASKBIDvol.Bidv = bidv;
                                            bidv = checkASKBIDvol.Bidv;
                                            checkASKBIDvol.Price = price;
                                            price = checkASKBIDvol.Price;
                            
                                            if (cacheASKBIDvol != null)
                                                for (int idx = 0; idx < cacheASKBIDvol.Length; idx++)
                                                    if (cacheASKBIDvol[idx].Askv == askv && cacheASKBIDvol[idx].Bidv == bidv && cacheASKBIDvol[idx].Price == price && cacheASKBIDvol[idx].EqualsInput(input))
                                                        return cacheASKBIDvol[idx];
                            
                                            ASKBIDvol indicator = new ASKBIDvol();
                                            indicator.BarsRequired = BarsRequired;
                                            indicator.CalculateOnBarClose = CalculateOnBarClose;
                            #if NT7
                                            indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256;
                                            indicator.MaximumBarsLookBack = MaximumBarsLookBack;
                            #endif
                                            indicator.Input = input;
                                            indicator.Askv = askv;
                                            indicator.Bidv = bidv;
                                            indicator.Price = price;
                                            Indicators.Add(indicator);
                                            indicator.SetUp();
                            
                                            ASKBIDvol[] tmp = new ASKBIDvol[cacheASKBIDvol == null ? 1 : cacheASKBIDvol.Length + 1];
                                            if (cacheASKBIDvol != null)
                                                cacheASKBIDvol.CopyTo(tmp, 0);
                                            tmp[tmp.Length - 1] = indicator;
                                            cacheASKBIDvol = tmp;
                                            return indicator;
                                        }
                                    }
                                }
                            }
                            
                            // This namespace holds all market analyzer column definitions and is required. Do not change it.
                            namespace NinjaTrader.MarketAnalyzer
                            {
                                public partial class Column : ColumnBase
                                {
                                    /// <summary>
                                    /// Enter the description of your new custom indicator here
                                    /// </summary>
                                    /// <returns></returns>
                                    [Gui.Design.WizardCondition("Indicator")]
                                    public Indicator.ASKBIDvol ASKBIDvol(int askv, int bidv, int price)
                                    {
                                        return _indicator.ASKBIDvol(Input, askv, bidv, price);
                                    }
                            
                                    /// <summary>
                                    /// Enter the description of your new custom indicator here
                                    /// </summary>
                                    /// <returns></returns>
                                    public Indicator.ASKBIDvol ASKBIDvol(Data.IDataSeries input, int askv, int bidv, int price)
                                    {
                                        return _indicator.ASKBIDvol(input, askv, bidv, price);
                                    }
                                }
                            }
                            
                            // This namespace holds all strategies and is required. Do not change it.
                            namespace NinjaTrader.Strategy
                            {
                                public partial class Strategy : StrategyBase
                                {
                                    /// <summary>
                                    /// Enter the description of your new custom indicator here
                                    /// </summary>
                                    /// <returns></returns>
                                    [Gui.Design.WizardCondition("Indicator")]
                                    public Indicator.ASKBIDvol ASKBIDvol(int askv, int bidv, int price)
                                    {
                                        return _indicator.ASKBIDvol(Input, askv, bidv, price);
                                    }
                            
                                    /// <summary>
                                    /// Enter the description of your new custom indicator here
                                    /// </summary>
                                    /// <returns></returns>
                                    public Indicator.ASKBIDvol ASKBIDvol(Data.IDataSeries input, int askv, int bidv, int price)
                                    {
                                        if (InInitialize && input == null)
                                            throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method");
                            
                                        return _indicator.ASKBIDvol(input, askv, bidv, price);
                                    }
                                }
                            }
                            #endregion

                            Comment


                              #15
                              Ketron82,

                              The screenshot you sent shows compile errors but not for the indicator in question. The errors are actually point towards another indicator called ASKBIDPRICE.CS

                              I would open that file and compile that code.
                              Cal H.NinjaTrader Customer Service

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by algospoke, Today, 06:40 PM
                              0 responses
                              9 views
                              0 likes
                              Last Post algospoke  
                              Started by maybeimnotrader, Today, 05:46 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post maybeimnotrader  
                              Started by quantismo, Today, 05:13 PM
                              0 responses
                              7 views
                              0 likes
                              Last Post quantismo  
                              Started by AttiM, 02-14-2024, 05:20 PM
                              8 responses
                              168 views
                              0 likes
                              Last Post jeronymite  
                              Started by cre8able, Today, 04:22 PM
                              0 responses
                              10 views
                              0 likes
                              Last Post cre8able  
                              Working...
                              X