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

block size

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

    block size

    I am trying to extract the block size like the time and sales how can I extract data of the block size number and if it was an ask or bid?

    #2
    Hello Ballboy11,

    Thank you for your note.

    The following code in an indicator/strategy which CalculateOnBarClose set to false so it updates on each tick, would compare if the last trade was at the Current Ask or Bid, and if so would print the time, Ask/Bid, Price, and Volume.

    Code:
    if(Close[0] == GetCurrentBid())
    	{
    		Print(Time[0].ToString() + ".." + "Bid" + "..."+Close[0].ToString() +".."+ Volume[0]);
    		
    	}
    if(Close[0] == GetCurrentAsk())
    	{
    		Print(Time[0].ToString() + ".." + "Ask" + "..."+Close[0].ToString() +".."+ Volume[0]);
    	}
    See GetCurrentAsk section of our helpguide,


    See GetCurrentBid section of our helpguide,


    See Volume section of our helpguide,


    Please let us know if you need further assistance.
    Last edited by NinjaTrader_AlanP; 03-31-2017, 08:05 AM.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      almost but not yet

      I tried the information and it shows the total contracts at close[0] by the time frame used.what I am trying to do is to catch the block sizes like the T & S displays. I want to create an algorithm that will paint a horizontal line on the price point if a certain block size is reached.

      for example

      if block is over 100 contracts at 50.05 then paint a horizontal line at 50.05

      thank you

      Comment


        #4
        Hello Ballboy11,

        When you applied the code, did you have calculate on bar close set to false? If so, you should see the output window reflect what the time and sales window is showing, each trade.

        To have a horizontal line painted when more than 100 contracts trade at 1 time, you would have to write an if statement which would check if Volume[0] was greater than 100, if so, do something.

        For example,

        Code:
        if(Volume[0]>100)
        {
        Print(“Volume over 100”);
        }
        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by love2code2trade, 04-17-2024, 01:45 PM
        4 responses
        31 views
        0 likes
        Last Post love2code2trade  
        Started by cls71, Today, 04:45 AM
        2 responses
        10 views
        0 likes
        Last Post eDanny
        by eDanny
         
        Started by proptrade13, Today, 11:06 AM
        0 responses
        5 views
        0 likes
        Last Post proptrade13  
        Started by kulwinder73, Today, 10:31 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by RookieTrader, Today, 09:37 AM
        3 responses
        15 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X