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 Segwin, 05-07-2018, 02:15 PM
        14 responses
        1,789 views
        0 likes
        Last Post aligator  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        6 responses
        837 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by jxs_xrj, 01-12-2020, 09:49 AM
        6 responses
        3,293 views
        1 like
        Last Post jgualdronc  
        Started by Touch-Ups, Today, 10:36 AM
        0 responses
        13 views
        0 likes
        Last Post Touch-Ups  
        Started by geddyisodin, 04-25-2024, 05:20 AM
        11 responses
        63 views
        0 likes
        Last Post halgo_boulder  
        Working...
        X