Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

block orders in analyzer

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

    block orders in analyzer

    I want to display block orders in the market analyzer.



    if ( e.Volume >= BlockSize )
    {
    PriceAlert.Set(e.Volume);
    }


    It is showing the current price and so is interfering with the conditions I am trying to use in the analyzer.

    #2
    Hello,

    You would need to ensure you are setting a default value for the plot being used.
    If you are seeing the Current price, that would indicate no default value was set.

    Generally for indicators specific to the MA, you would need to set an initial value for the plot in the top of OnBarUpdate before conditions.

    Here would be an example:

    Code:
    PriceAlert.Set(0);
    
    if ( e.Volume >= BlockSize )
    {
    PriceAlert.Set(e.Volume);
    }
    Could you check and confirm if this is the problem?


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Yes now shows 0 but is not showing the block trade amounts.

      Comment


        #4
        Hello,

        Yes this would correct the default price showing, but if your logic does not persist the last value it would only report the block size for a split second while that tick is processed. Upon the next tick a zero would be reported again replacing the value.

        You would likely need to implement a variable to "remeber" what the last block was.

        Here is a simple example:

        Code:
        private int lastValue = 0;
        protected override void OnBarUpdate()
        {
            PriceAlert.Set(lastValue);
        
            if ( e.Volume >= BlockSize )
            {
                 PriceAlert.Set(e.Volume);
                 lastValue = PriceAlert[0];
            }
        }
        Because the MA is generally used with CalculateOnBarClose = false, in some cases if you want a display that persists you would need to do that using logic.

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          It says cannot convert double into int

          lastValue = PriceAlert[0];


          error referring to "PriceAlert"

          Comment


            #6
            Hello,

            This was my mistake, You would need a Cast in this case:

            lastValue = (int)PriceAlert[0];

            I look forward to being of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by lightsun47, Today, 03:51 PM
            0 responses
            4 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            8 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            44 views
            0 likes
            Last Post futtrader  
            Started by Option Whisperer, Today, 09:55 AM
            1 response
            13 views
            0 likes
            Last Post bltdavid  
            Started by port119, Today, 02:43 PM
            0 responses
            8 views
            0 likes
            Last Post port119
            by port119
             
            Working...
            X