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).
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

[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

Comment