PDA

View Full Version : DrawFibonacciExtensions Error


Ironleg
12-11-2008, 03:44 PM
Hi
I am just simply trying to place a Fibonachi Extension EUR/USD, but get following error:
11/12/2008 22:38:17 Default Error on calling the 'OnBarUpdate' method for indicator 'MyZigZag' on bar 0: MyZigZag.DrawFibonacciExtensions: anchor1BarsAgo out of valid range 0 through 0, was 38.

My Code:
DrawFibonacciExtensions("tag1", true, 38, 1.3305, 31, 1.334, 28, 1.3309);

Please help

NinjaTrader_Josh
12-11-2008, 03:47 PM
Hi Ironleg,

Welcome to the NinjaTrader Support Forums. Please see this tip: http://www.ninjatrader-support2.com/vb/showthread.php?t=3170

Ironleg
12-11-2008, 03:57 PM
Hi Ironleg,

Welcome to the NinjaTrader Support Forums. Please see this tip: http://www.ninjatrader-support2.com/vb/showthread.php?t=3170


Thank you very much!

Ralph
12-12-2008, 07:53 AM
Your method seems to be executed on bar0, which doesn't make sense I guess.

Regards
Ralph

Ironleg
12-12-2008, 08:18 AM
Your method seems to be executed on bar0, which doesn't make sense I guess.

Regards
Ralph

It does... look at the link above, when you reload the script it will call this method on every OnBarUpdate from the start, but from the start I don't have enough bars, so if I do something like this

protected override void OnBarUpdate()
{
if (CurrentBar < 50)
return;

DrawFobo();
}

It will not throw an error, I just need no less than 42 bars drawn in the case of the method in my first post

Ralph
12-12-2008, 09:04 AM
I didn't notice Josh's link (time is due for the holidays). Sorry, and welcome too to the forum.

Regards
Ralph

Ironleg
12-12-2008, 09:19 AM
I didn't notice Josh's link (time is due for the holidays). Sorry, and welcome too to the forum.

Regards
Ralph

Thank you, I am new to NinjaTrader, but being a .Net C# developer, love it so far very very much :)

Here is another question:

Is it possible to access drawn objects like FiboExtension for it's levels via name or id?

NinjaTrader_Josh
12-12-2008, 09:22 AM
We do not support accessing draw objects through NinjaScript. If you want to remember it's values you should store calculations that determine them for use later on.

Ironleg
12-12-2008, 09:32 AM
We do not support accessing draw objects through NinjaScript. If you want to remember it's values you should store calculations that determine them for use later on.

it's a pity... it would've been a killer feature, not only in regards of Fibs, but for all objects on the chart, will have to find a work around.