MarketDepthPrinter1.cs | The type or namespace name 'MarketDepthEventArgs' could not be found (are you missing a using directive or an assembly reference?) | CS0246 | 28 | 47 |
Can anyone help me fix this? I have gpt+ which can browse the internet actively and we couldn't find the solution to this
using System;
using NinjaTrader.Cbi;
using NinjaTrader.Gui.Tools;
using NinjaTrader.NinjaScript;
using NinjaTrader.NinjaScript.Strategies;
namespace NinjaTrader.NinjaScript.Strategies
{
public class LimitOrderLine : Strategy
{
private double threshold;
private int lineThickness;
[NinjaScriptProperty]
public double Threshold
{
get { return threshold; }
set { threshold = value; }
}
[NinjaScriptProperty]
public int LineThickness
{
get { return lineThickness; }
set { lineThickness = value; }
}
protected override void OnMarketDepth(MarketDepthEventArgs marketDepthUpdate)
{
if (marketDepthUpdate.MarketDataType == MarketDataType.Last)
return;
double bidSize = marketDepthUpdate.MarketDepth.Bid[0].Size;
double askSize = marketDepthUpdate.MarketDepth.Ask[0].Size;
if (bidSize >= threshold || askSize >= threshold)
{
double priceLevel = (bidSize >= threshold) ? marketDepthUpdate.MarketDepth.Bid[0].Price : marketDepthUpdate.MarketDepth.Ask[0].Price;
Draw.Line(this, "ThresholdLine" + CurrentBar, false, 0, priceLevel, -1, priceLevel, Brushes.Blue, lineThickness);
}
}
}
}
Comment