i'm trying to build my first strategy. I want to use the values of the BuySellVolume indicator, but it seems like the DataSeries from the indicator are empty.
No trade entry happens with this strategy....
The code looks like this:
namespace NinjaTrader.NinjaScript.Strategies
{
public class DeltaRatioKursDivergenz : Strategy
{
private BuySellVolume bsv;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Description = @"Wenn Delta positiv, long gehen";
Name = "DeltaRatioKursDivergenz";
// Disable this property for performance gains in Strategy Analyzer optimizations
// See the Help Guide for additional information
IsInstantiatedOnEachOptimizationIteration = true;
}
else if (State == State.Configure)
{
}
else if (State == State.DataLoaded)
{
bsv = BuySellVolume();
AddChartIndicator(bsv);
}
}
protected override void OnBarUpdate()
{
if (bsv.Sells[0] > 0){
EnterLong();
}
}
}
}
Could you please help me with this? Thank you.
Kind regars,
Malte
Comment