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 RubenCazorla, Today, 09:07 AM
            1 response
            5 views
            0 likes
            Last Post RubenCazorla  
            Started by Irukandji, Today, 09:34 AM
            0 responses
            3 views
            0 likes
            Last Post Irukandji  
            Started by TraderBCL, Today, 04:38 AM
            3 responses
            25 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            11 responses
            1,423 views
            0 likes
            Last Post jculp
            by jculp
             
            Started by BarzTrading, Today, 07:25 AM
            2 responses
            29 views
            1 like
            Last Post BarzTrading  
            Working...
            X