Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Above ask / Below bid

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

    Above ask / Below bid

    Just a quick question, as I can't find the answer in the forum.
    I want to recognize above ask or below bid transactions, and plot dots on a tick chart to highlight the bar where it occur.

    Modifying the BuySellVolume indicator, I test for before last tick size = before last ask size, and current price above last price (to recognise an above ask transaction).
    But when comparing with T&S, it does not match.

    My question : am I testing it the right way ? is it logically correct ?

    PS : if you don't mind added a few word regarding the role of arraylist alBuy and alSell. In what are they usefull ?

    Thank you for your answer

    Code:
                if (firstPaint)
                    firstPaint = false;
                else
                {
                    double tradeVol = previousVol == 0 ? Volume[0] : Volume[0] - previousVol;
                    if (Close[0] >= GetCurrentAsk() && tradeVol >= minTradeVol)
                    {
                        buys += tradeVol;
                        if(previousVol == previousAskVol && Close[0] > previousAsk)
                            Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Above Ask", "Alert2.wav", 1, Color.Black, Color.Yellow);
                        if(tradeVol >= minBigVol && !Historical)
                            DrawDot("BigVol" + CurrentBar.ToString(), true, 0, Close[0], Color.LimeGreen);
                    }
                    else if (Close[0] <= GetCurrentBid() && tradeVol >= minTradeVol) 
                    {
                        sells += tradeVol;
                        if(previousVol == previousBidVol && Close[0] < previousBid)
                            Alert("myAlert", NinjaTrader.Cbi.Priority.High, "Below Bid", "C:\\WINDOWS\\Media\\Windows XP Ding.wav", 1, Color.Black, Color.Yellow);
                        if(tradeVol >= minBigVol && !Historical)
                            DrawDot("BigVol" + CurrentBar.ToString(), true, 0, Close[0], Color.Red);
    
                    }
                }
    
                previousVol = Volume[0];
                previousAsk = GetCurrentAsk();
                previousBid = GetCurrentBid();
                previousAskVol = GetCurrentAskVolume();
                previousBidVol = GetCurrentBidVolume();

    #2
    Hi fle,

    Welcome to the NinjaTrader forum, you might want to dive into this discussion here - http://www.ninjatrader-support2.com/...ead.php?t=4231

    I believe it answers some of your questions how to approach your project.

    Comment


      #3
      Thank you for your prompt answer. This link is indeed very interesting.

      But I'm afraid it does not answer my main concern, regarding how I can spot above bid or below ask condition.
      like if I test for
      "before last" ticksize = "before last" asksize, and last price above "before last" price
      means that it is an above ask transactions ?
      Regards

      Comment


        #4
        Hi fle__,
        I guess with TickSize you mean the volume / transactions occured on the last tick. Best would be to debug your logic and watching the times and sales window for confirmation, then you know when you are on the right track.

        Comment


          #5
          OK, thank you

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          612 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          355 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          105 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          561 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          564 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X