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 Taddypole, 04-26-2024, 02:47 PM
    1 response
    12 views
    0 likes
    Last Post NinjaTrader_Eduardo  
    Started by futtrader, 04-21-2024, 01:50 AM
    6 responses
    58 views
    0 likes
    Last Post futtrader  
    Started by sgordet, Today, 11:48 AM
    0 responses
    4 views
    0 likes
    Last Post sgordet
    by sgordet
     
    Started by Trader146, Today, 11:41 AM
    0 responses
    5 views
    0 likes
    Last Post Trader146  
    Started by jpapa, 04-23-2024, 07:22 AM
    2 responses
    22 views
    0 likes
    Last Post rene69851  
    Working...
    X