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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    601 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    347 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    559 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    558 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X