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

Calculate.OnBarClose and Volumetric Bars

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

    Calculate.OnBarClose and Volumetric Bars

    I am creating a strategy where I would use Volumetric Bars as a secondary time series (15 minutes) and the entry would be done from a shorter time frame bar.

    I want to access the Bid / Ask volume from the 15 volumetric bar in progress. (barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Low[0])

    Using this code I believe I would return the volume value from the previous closed 15 minute bar.
    I think I would have to use Calculate.OnEachTick instead of Calculate.OnBarClose to access the volume on the bar that is forming.
    But I want the actual entry to be on the close of the shorter time frame bar.

    Am I understanding this correctly and if so is there a way to accomplish this.

    #2
    Hello sdauteuil,

    If you are using that code from the BarsInProgress which the entry would be submitted the CurrentBar won't be that of the volumetric series. You would need to use that code from within a BarsInProgress condition to target the correct data series for the volumetric. By doing that you could store whatever Volumetric values needed to variables which can be later re used in other BarsInProgress conditions.

    To access current building bar values you would need to use OnEachTick.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Is it possible to have the BarsInProgress condition for the entry bar use CalculateOnBarClose
      and the BarsInProgress condition for the Volumetric bar use CalculateOnEachTick?

      If the above is not possible.

      If I have the BarsInProgress for the volumetric bar at 1 tick could I keep a running sum the volumes at each price level?
      Would that sum on each tick as the entry bar is forming?

      What I am trying to accomplish is to check if there is net buying volume above and below the current price of the entry bar.


      Thanks for the help

      Comment


        #4
        Hello sdauteuil,

        You can simulate OnBarClose by using IsFirstTickOfBar: https://ninjatrader.com/support/help...FirstTickOfBar

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by arvidvanstaey, Today, 02:19 PM
        4 responses
        11 views
        0 likes
        Last Post arvidvanstaey  
        Started by samish18, 04-17-2024, 08:57 AM
        16 responses
        61 views
        0 likes
        Last Post samish18  
        Started by jordanq2, Today, 03:10 PM
        2 responses
        9 views
        0 likes
        Last Post jordanq2  
        Started by traderqz, Today, 12:06 AM
        10 responses
        18 views
        0 likes
        Last Post traderqz  
        Started by algospoke, 04-17-2024, 06:40 PM
        5 responses
        48 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X