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 judysamnt7, 03-13-2023, 09:11 AM
        4 responses
        53 views
        0 likes
        Last Post DynamicTest  
        Started by ScottWalsh, Today, 06:52 PM
        4 responses
        33 views
        0 likes
        Last Post ScottWalsh  
        Started by olisav57, Today, 07:39 PM
        0 responses
        5 views
        0 likes
        Last Post olisav57  
        Started by trilliantrader, Today, 03:01 PM
        2 responses
        19 views
        0 likes
        Last Post helpwanted  
        Started by cre8able, Today, 07:24 PM
        0 responses
        6 views
        0 likes
        Last Post cre8able  
        Working...
        X