It should read out the levels from a user drawn fibonacci retracement and add them to a list.
if (IsFirstTickOfBar && DrawObjects["MyFib"] as DrawingTools.FibonacciRetracements != null)
{
dynamic temp = DrawObjects["MyFib"];
if (temp.ToString().Equals("NinjaTrader.NinjaScript.DrawingTools.FibonacciRetracements"))
{
foreach (PriceLevel p in temp.PriceLevels)
{
if (Time[0]>temp.EndAnchor.Time && !(levels.ContainsKey("FibLevel"+p.Value.ToString(""))))
levels.Add("FibLevel"+p.Value.ToString(""),p.GetPrice(temp.StartAnchor.Price, temp.EndAnchor.Price - temp.StartAnchor.Price, true));
}
}
}
Many thanks


Comment