Fractals indicator keeps returning 0.00000

How to create strategies and indicators
Message
Author
Coen
Posts: 1
Joined: Sat Jul 28, 2012 10:22 am
Location: Gibraltar

Fractals indicator keeps returning 0.00000

#1 Postby Coen » Sat Jul 28, 2012 10:26 am

Hi,

I am programming my strategy in C++ and I use the fractals indicator.

I have following code:

EXPORT void __stdcall ResetStrategy()
{
indFractalM15 = CreateIndicator("EURUSD", 15, "Fractals", "");


}


and

EXPORT void __stdcall GetSingleTick()
{

double dFractalUp;


if (Bars() < 10) return;

dFractalUp = GetIndicatorValue(indFractalM15,2,0);

...

}

But dFractalUp keeps returning 0.
indFractalM15 (the indicator) is != 0.
Learn to trade!
www.tradimo.com

User avatar
Terranin
Site Admin
Posts: 833
Joined: Sat Oct 21, 2006 4:39 pm

#2 Postby Terranin » Tue Jul 31, 2012 2:44 pm

First of all, are you sure that there is a fractal on the 2nd bar? There could be nothing. Does it return 0 on EVERY bar? Because there could be many ticks in every bar you can have many 0s before you get some value.
Hasta la vista
Mike


Return to “FT API”

Who is online

Users browsing this forum: No registered users and 26 guests