Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    BertrandNinjaTrader Customer Service

    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.
        BertrandNinjaTrader Customer Service

        Comment


          #5
          OK, thank you

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by inanazsocial, Today, 01:15 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Jason  
          Started by rocketman7, Today, 02:12 AM
          0 responses
          10 views
          0 likes
          Last Post rocketman7  
          Started by dustydbayer, Today, 01:59 AM
          0 responses
          1 view
          0 likes
          Last Post dustydbayer  
          Started by trilliantrader, 04-18-2024, 08:16 AM
          5 responses
          23 views
          0 likes
          Last Post trilliantrader  
          Started by Davidtowleii, Today, 12:15 AM
          0 responses
          3 views
          0 likes
          Last Post Davidtowleii  
          Working...
          X