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

How do I get the volume at price?

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

    How do I get the volume at price?

    I want to make something automated to get the volume at the current price and then based on the volume, it would enter into a long or short trade. Is there a way to do this? For example, if the price of the YM is trading at 24000, the bid volume is 24 and ask is 7, I want to enter a long trade.

    #2
    Hello jertrade,

    Thanks for your post.

    You could use OnMaketData and track the volume that comes in for each Bid and Ask update. This will tell you the current volume for Bid/Ask as it comes in. You could then add your trading logic within OnMarketData to enter off of these signals since the Bid/Ask will update more frequently here than using OnBarUpdate to trigger your order submissions.

    The documentation page below provides some sample code for displaying the bid ask and last volume.



    Please let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by briansaul, Today, 05:31 AM
    0 responses
    2 views
    0 likes
    Last Post briansaul  
    Started by fwendolynlpxz, Today, 05:19 AM
    0 responses
    4 views
    0 likes
    Last Post fwendolynlpxz  
    Started by traderqz, Yesterday, 12:06 AM
    11 responses
    28 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by PaulMohn, Today, 03:49 AM
    0 responses
    8 views
    0 likes
    Last Post PaulMohn  
    Started by inanazsocial, Today, 01:15 AM
    1 response
    10 views
    0 likes
    Last Post NinjaTrader_Jason  
    Working...
    X