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 SantoshXX, Today, 03:09 AM
            0 responses
            12 views
            0 likes
            Last Post SantoshXX  
            Started by DanielTynera, Today, 01:14 AM
            0 responses
            2 views
            0 likes
            Last Post DanielTynera  
            Started by yertle, 04-18-2024, 08:38 AM
            9 responses
            42 views
            0 likes
            Last Post yertle
            by yertle
             
            Started by techgetgame, Yesterday, 11:42 PM
            0 responses
            14 views
            0 likes
            Last Post techgetgame  
            Started by sephichapdson, Yesterday, 11:36 PM
            0 responses
            2 views
            0 likes
            Last Post sephichapdson  
            Working...
            X