Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

ticks per level

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

    ticks per level

    Is there a function to call the ticks per level from ninjascript easily?
    The indicators I have developed do not show correct results when I change this parameter​
    Attached Files

    #2

    Hello franki,

    If you are asking how to specify this from AddVolumetric(), there is a parameter for this.
    AddVolumetric(string instrumentName, Data.BarsPeriodType baseBarsPeriodType, int baseBarsPeriodTypeValue, Data.VolumetricDeltaType deltaType, int tickPerLevel)


    If you are asking about using Volumetric bars in the code, there is a note on this in the help guide for GetMaximumVolume().
    "For scenarios where Ticks per level is greater than 1, this method will return the lowest price - with Ticks per level known, the remaining prices in the result cell could be custom calculated if desired."


    You can loop by the BarsPeriod.Value to loop by the TicksPerLevel
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[BarsInProgress].BarsType as
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

    if (barsType == null)
    return;
    try
    {
    for (double rowPrice = High[0]; rowPrice >= Low[0]; rowPrice -= TickSize * BarsPeriod.Value)
    {
    double price;
    Print("\r\nrowPrice: " + rowPrice);
    Print("Delta for Close: " + barsType.Volumes[CurrentBar].GetDeltaForPrice(rowPrice));
    Print("Bid for Close: " + barsType.Volumes[CurrentBar].GetBidVolumeForPrice(rowPrice));
    Print("Ask for Close: " + barsType.Volumes[CurrentBar].GetAskVolumeForPrice(rowPrice));
    }
    }
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    52 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    71 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    38 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    99 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    60 views
    0 likes
    Last Post PaulMohn  
    Working...
    X