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 inanazsocial, Today, 01:15 AM
            0 responses
            0 views
            0 likes
            Last Post inanazsocial  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            5 responses
            22 views
            0 likes
            Last Post trilliantrader  
            Started by Davidtowleii, Today, 12:15 AM
            0 responses
            3 views
            0 likes
            Last Post Davidtowleii  
            Started by guillembm, Yesterday, 11:25 AM
            2 responses
            9 views
            0 likes
            Last Post guillembm  
            Started by junkone, 04-21-2024, 07:17 AM
            9 responses
            70 views
            0 likes
            Last Post jeronymite  
            Working...
            X