Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help changing resolution type of TDU Volume Profile

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

    Help changing resolution type of TDU Volume Profile

    Hi,

    I would like some help with a 3rd party indicator. Unfortunately, TDU's support is unhelpful and redirected me here.

    I'm currently trying to change the parameters of the Volume Profile indicator from Trade Devil. I plan to use it on a ranged bar type's chart. This means the default 1 second bar calculation(resolution) by the indicator won't work and I need to use the 1 tick bar calculation. This change is easily doable via an enum on the indicator panel on the chart (see screenshot).​

    Click image for larger version

Name:	image.png
Views:	325
Size:	23.8 KB
ID:	1313600

    I've taken the time to study the different options TDU gave me via ninjascript intellisence. With this, I'm successfully able to change the Profile type to "Xbars", the bars count and the ticks per level to my liking, once the Volume profile is called. Unfortunately, to my understanding I can't do the same with the resolution chosen for the calculation (and I tried), as it needs to know which dataseries to calculate before... you know... calculating. The only parameters available for TDUVolumeProfile() is the dataseries on which you want to use the VP. So I can't change the enum selected while calling the indicator, as those parameters' properties weren't added in the 3rd party indicator's code.

    I've added my code below. Does anyone have possible solutions?

    Thank you for your time​​

    Code:
    [HASHTAG="t3322"]region[/HASHTAG] Using declarations
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.ComponentModel.DataAnnotations;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Xml.Serialization;
    using NinjaTrader.Cbi;
    using NinjaTrader.Gui;
    using NinjaTrader.Gui.Chart;
    using NinjaTrader.Gui.SuperDom;
    using NinjaTrader.Gui.Tools;
    using NinjaTrader.Data;
    using NinjaTrader.NinjaScript;
    using NinjaTrader.Core.FloatingPoint;
    using NinjaTrader.NinjaScript.DrawingTools;
    using NinjaTrader.NinjaScript.Indicators.TDU;
    #endregion
    
    //This namespace holds Indicators in this folder and is required. Do not change it.
    namespace NinjaTrader.NinjaScript.Indicators
    {
    public class TestVPTDU : Indicator
    {
    
    private NinjaTrader.NinjaScript.Indicators.TDU.TDUVolumeProfile VP;
    
    protected override void OnStateChange()
    {
    
    if (State == State.SetDefaults)
    {
    Description = @"Enter the description for your new custom Indicator here.";
    Name = "TestVPTDU";
    Calculate = Calculate.OnEachTick;
    IsOverlay = false;
    DisplayInDataBox = true;
    DrawOnPricePanel = true;
    DrawHorizontalGridLines = true;
    DrawVerticalGridLines = true;
    PaintPriceMarkers = true;
    ScaleJustification = NinjaTrader.Gui.Chart.ScaleJustification.Right;
    //Disable this property if your indicator requires custom values that cumulate with each new market data event.
    //See Help Guide for additional information.
    IsSuspendedWhileInactive = true;
    AddPlot(Brushes.DodgerBlue, NinjaTrader.Custom.Resource.KeyReversalPlot0);
    
    }
    else if (State == State.Configure)
    {
    AddDataSeries(BarsPeriodType.Second, 1); // default resolution
    AddDataSeries(BarsPeriodType.Tick, 1); // data series I would like to use for my calculation
    }
    
    else if (State == State.DataLoaded)
    {
    VP = TDUVolumeProfile(Close);
    }
    }
    
    protected override void OnBarUpdate()
    {
    if (BarsInProgress !=0)
    {
    return;
    }
    
    if (CurrentBars[0] < 2)
    {
    return;
    }
    
    VP.ResolutionPeriodPeriod = TDUVPResolutionPeriod.Tick; // This does nothing
    VP.ResolutionInterval = 1; // This does nothing
    
    VP.VolumeProfileMethod = TDUVPProfileType.EveryXBars; // This works
    VP.BarCount = 50; // This works
    
    VP.TickAggregation = 1; // This works
    
    Value[0] = VP.PreviousVPValueAreaHigh[0];
    
    }
    
    }
    }
    
    [HASHTAG="t3322"]region[/HASHTAG] NinjaScript generated code. Neither change nor remove.
    
    namespace NinjaTrader.NinjaScript.Indicators
    {
    public partial class Indicator : NinjaTrader.Gui.NinjaScript.IndicatorRenderBase
    {
    private TestVPTDU[] cacheTestVPTDU;
    public TestVPTDU TestVPTDU()
    {
    return TestVPTDU(Input);
    }
    
    public TestVPTDU TestVPTDU(ISeries<double> input)
    {
    if (cacheTestVPTDU != null)
    for (int idx = 0; idx < cacheTestVPTDU.Length; idx++)
    if (cacheTestVPTDU[idx] != null && cacheTestVPTDU[idx].EqualsInput(input))
    return cacheTestVPTDU[idx];
    return CacheIndicator<TestVPTDU>(new TestVPTDU(), input, ref cacheTestVPTDU);
    }
    }
    }
    
    namespace NinjaTrader.NinjaScript.MarketAnalyzerColumns
    {
    public partial class MarketAnalyzerColumn : MarketAnalyzerColumnBase
    {
    public Indicators.TestVPTDU TestVPTDU()
    {
    return indicator.TestVPTDU(Input);
    }
    
    public Indicators.TestVPTDU TestVPTDU(ISeries<double> input )
    {
    return indicator.TestVPTDU(input);
    }
    }
    }
    
    namespace NinjaTrader.NinjaScript.Strategies
    {
    public partial class Strategy : NinjaTrader.Gui.NinjaScript.StrategyRenderBase
    {
    public Indicators.TestVPTDU TestVPTDU()
    {
    return indicator.TestVPTDU(Input);
    }
    
    public Indicators.TestVPTDU TestVPTDU(ISeries<double> input )
    {
    return indicator.TestVPTDU(input);
    }
    }
    }
    
    #endregion
    ​

    #2
    Hello NV020Forum,

    Because this is a third party item our support would not have any details about how this item can be used. If there is a overload that has the parameter you want to change you would need to use that. This would otherwise be a question that the developer of this item would need to answer. If any other forum users also use this software they may be able to answer as well.

    You can try using the strategy builder as well, that will let you see which parameters can be changed and then you can press view code to get the generated code.

    Comment


      #3
      Hi Jesse.

      I'm pretty sure VP.ResolutionPeriodPeriod = TDUVPResolutionPeriod.Tick is the overload in question. I simply don't know how to use it for the changes to happens

      Comment


        #4
        Hello NV020Forum,

        Unfortunately I would not know if that can be toggled like you have in your code as that is a custom item. The way you are trying to set the property is similar to how you would set properties in an indicator however depending on how that item is coded that may or may not work. The best resource would be the original developer as they would be able to say if that will or will not work.

        Comment


          #5
          Thank you for your help! Let's hope someone else do have an answer

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          574 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X