Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Delta Divergence use VolumetricBarsType

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

    Delta Divergence use VolumetricBarsType

    I want to use Order Flow Volumetric Bars

    else if (State == State.Configure)
    {

    AddVolumetric(Instrument.FullName, BarsPeriodType.Minute, BarsPeriod.Value);


    ANT THIS,same result

    AddVolumetric(NinjaTrader.NinjaScript.BarsTypes.Vo lumetricBarsType barsType = BarsArray[1].BarsType as NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe);
    }​​

    I have this error
    FSMTDeltacs No overload for method 'AddVolumetric' takes 3 arguments CS1501
    Click image for larger version

Name:	image.png
Views:	274
Size:	2.7 KB
ID:	1335958


    NinjaTrader 8
    NinjaTrader ===> protected override void OnBarUpdate()
    {
    if (Bars == null)
    return;

    // This sample assumes the Volumetric series is the primary DataSeries on the chart, if you would want to add a Volumetric series to a
    // script, you could call AddVolumetric() in State.Configure and then for example use
    // NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = BarsArray[1].BarsType as
    // NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe barsType = Bars.BarsSeries.BarsType as
    NinjaTrader.NinjaScript.BarsTypes.VolumetricBarsTy pe;

    if (barsType == null)
    return;

    try
    {
    double price;
    Print("=========================================== ==============================");
    Print("Bar: " + CurrentBar);
    Print("Trades: " + barsType.Volumes[CurrentBar].Trades);
    Print("Total Volume: " + barsType.Volumes[CurrentBar].TotalVolume);
    Print("Total Buying Volume: " + barsType.Volumes[CurrentBar].TotalBuyingVolume);
    Print("Total Selling Volume: " + barsType.Volumes[CurrentBar].TotalSellingVolume);
    Print("Delta for bar: " + barsType.Volumes[CurrentBar].BarDelta);
    Print("Delta for bar (%): " + barsType.Volumes[CurrentBar].GetDeltaPercent());
    Print("Delta for Close: " + barsType.Volumes[CurrentBar].GetDeltaForPrice(Close[0]));
    Print("Ask for Close: " + barsType.Volumes[CurrentBar].GetAskVolumeForPrice(Close[0]));
    Print("Bid for Close: " + barsType.Volumes[CurrentBar].GetBidVolumeForPrice(Close[0]));
    Print("Volume for Close: " + barsType.Volumes[CurrentBar].GetTotalVolumeForPrice(Close[0]));
    Print("Maximum Ask: " + barsType.Volumes[CurrentBar].GetMaximumVolume(true, out price) + " at price: " + price);
    Print("Maximum Bid: " + barsType.Volumes[CurrentBar].GetMaximumVolume(false, out price) + " at price: " + price);
    Print("Maximum Combined: " + barsType.Volumes[CurrentBar].GetMaximumVolume(null, out price) + " at price: " + price);
    Print("Maximum Positive Delta: " + barsType.Volumes[CurrentBar].GetMaximumPositiveDelta());
    Print("Maximum Negative Delta: " + barsType.Volumes[CurrentBar].GetMaximumNegativeDelta());
    Print("Max seen delta (bar): " + barsType.Volumes[CurrentBar].MaxSeenDelta);
    Print("Min seen delta (bar): " + barsType.Volumes[CurrentBar].MinSeenDelta);
    Print("Cumulative delta (bar): " + barsType.Volumes[CurrentBar].CumulativeDelta);
    Print("Delta Since High (bar): " + barsType.Volumes[CurrentBar].DeltaSh);
    Print("Delta Since Low (bar): " + barsType.Volumes[CurrentBar].DeltaSl);
    }
    catch{}
    }​

    #2
    Hello fersanmito,

    You are missing the instrument name but also you are using variables which will not correctly work to load data. The Add data methods like AddDataSeries or AddVolumetric cannot use variables to load data, you need to type in the values to have it work right.

    Comment


      #3
      Thanks I find the solution ===>
      Syntax


      AddVolumetric(string instrumentName, Data.BarsPeriodType baseBarsPeriodType, int baseBarsPeriodTypeValue, Data.VolumetricDeltaType deltaType, int tickPerLevel)

      AddVolumetric(string instrumentName, Data.BarsPeriodType baseBarsPeriodType, int baseBarsPeriodTypeValue, Data.VolumetricDeltaType deltaType, int tickPerLevel, bool? isResetOnNewTradingDay)

      AddVolumetric(string instrumentName, Data.BarsPeriodType baseBarsPeriodType, int baseBarsPeriodTypeValue, Data.VolumetricDeltaType deltaType, int tickPerLevel, string tradingHoursName, bool? isResetOnNewTradingDay)

      AddVolumetric(string instrumentName, Data.BarsPeriodType baseBarsPeriodType, int baseBarsPeriodTypeValue, Data.VolumetricDeltaType deltaType, int tickPerLevel, int sizeFilter, string tradingHoursName, bool? isResetOnNewTradingDay) (R17 and higher only)
      Warning
      • This method should ONLY be called from the OnStateChange() method during State.Configure
      • Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddVolumetric() calls as those hosted scripts would. For further reference, please also review the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments
      • Arguments supplied to AddVolumetric() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result in an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner.

      Comment


        #4
        Hi, fersanmito
        I am also facing the same issue. Can you please help me to solve this?

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X