I'm trying to get the fibo retracements levels given a tag name. The script captures the object but when tries to read the levels appears the following error: "Error on calling 'OnBarUpdate' method on bar 4105: An unexpected exception occurred while binding a dynamic operation."
May I have to save the dynamic object before accessing the fibo levels?
The code:
-------
foreach (dynamic obj in DrawObjects.ToList())
{
if(obj.Tag.ToString().Equals("fibonacci_test"))
{
// Access the object by assuming that it is the Type we expect
Print(String.Format("FINONACCI {0} detected!", obj.Tag));
foreach (PriceLevel p in obj.PriceLevels)
{
Print(p.Value);
Print(p.GetPrice(obj.StartAnchor.Price, obj.EndAnchor.Price - obj.StartAnchor.Price, false));
}
}
}
-------
Thanks
Comment