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 CaptainJack, 05-29-2026, 05:09 AM
    0 responses
    245 views
    0 likes
    Last Post CaptainJack  
    Started by CaptainJack, 05-29-2026, 12:02 AM
    0 responses
    157 views
    0 likes
    Last Post CaptainJack  
    Started by charlesugo_1, 05-26-2026, 05:03 PM
    0 responses
    165 views
    1 like
    Last Post charlesugo_1  
    Started by DannyP96, 05-18-2026, 02:38 PM
    1 response
    250 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    201 views
    0 likes
    Last Post CarlTrading  
    Working...
    X