Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Quad, Ayumi, 1 invisible), 916 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 4 1 2 3 4
Please, help with Fractal indicator. #414747
01/07/13 11:39
01/07/13 11:39
Joined: Jan 2013
Posts: 26
Italy
M
Maruska Offline OP
Newbie
Maruska  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 26
Italy
I'm a c++ programmer but I have some difficults to understand indicators relations with MT4 equivalents.
For example in MT4 I can calculate the last high fractal with this function:

UpFractal = iFractals(Symbol(), tf, MODE_UPPER, 3);

in zorro the function is:

FractalHigh(var* Data, int TimePeriod)

I have tried this:

UpFractal = FractalHigh(series(price()),5)

but I don't understand the correlation with the two functions; in the FractalHigh function what TimePeriod means?

Thanks in advance and
congratulations with the excellent work with zorro.

Last edited by Maruska; 01/07/13 11:40.
Re: Please, help with Fractal indicator. [Re: Maruska] #414748
01/07/13 11:45
01/07/13 11:45
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I am not sure if iFractals is really the Fractal indicator, as MT4 often calculates indicators differently. The Fractal indicator needs a time period, which is just the number of bars from which the fractal is taken. The fact that this is missing in the MT4 version is suspicious. So please check what iFractals is doing at all and which time period it uses.

The "3" shift parameter in the iFractal example is the same as adding a "+2" to a series, like this:

UpFractal = FractalHigh(series(price())+2,5);

The source code of FractalHigh can be found in the indicators.c file.

Re: Please, help with Fractal indicator. [Re: jcl] #414750
01/07/13 12:08
01/07/13 12:08
Joined: Jan 2013
Posts: 26
Italy
M
Maruska Offline OP
Newbie
Maruska  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 26
Italy
Thanks for the fast reply, but my doubts remain.

I wrote a script like this for just to print out last up or down fractal:

function run()
{
BarPeriod = 5;

printf("\nUP = %.5f - DW = %.5f", FractalHigh(series(price())+2,5), FractalLow(series(price())+2,5));
}

but it is not working.

What is the correct way in zorro to get the last up or down fractal?

Re: Please, help with Fractal indicator. [Re: Maruska] #414752
01/07/13 12:12
01/07/13 12:12
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Your script looks correct to me.

I would use priceHigh for FractalHigh and priceLow for FractalLow, though. Shifting the Fractal by 2 bars probably also makes not much sense for signal generation.

Re: Please, help with Fractal indicator. [Re: jcl] #414755
01/07/13 12:47
01/07/13 12:47
Joined: Sep 2012
Posts: 99
T
TankWolf Offline
Junior Member
TankWolf  Offline
Junior Member
T

Joined: Sep 2012
Posts: 99
Just out of curiosity what sort of trading signals or strategies can be produced from using fractals? Haven't seen a lot about them in my trading experience.

Re: Please, help with Fractal indicator. [Re: TankWolf] #414757
01/07/13 13:19
01/07/13 13:19
Joined: Jan 2013
Posts: 26
Italy
M
Maruska Offline OP
Newbie
Maruska  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 26
Italy
I'm just trying to implement a Bill Williams strategy based on Alligator and Fractals.
I have tested it in the past with MT4, but since I have never been satisfied to mt4 backtest and I have just found this great product, I am trying it to zorro.

Re: Please, help with Fractal indicator. [Re: Maruska] #414758
01/07/13 13:20
01/07/13 13:20
Joined: Jan 2013
Posts: 26
Italy
M
Maruska Offline OP
Newbie
Maruska  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 26
Italy
I have found that what zorro print out with my previos script differ from the fractal printed out from the Trading Station software. This is normal?

Re: Please, help with Fractal indicator. [Re: Maruska] #414759
01/07/13 13:21
01/07/13 13:21
Joined: Nov 2012
Posts: 209
S
SFF Offline
Member
SFF  Offline
Member
S

Joined: Nov 2012
Posts: 209
Let me know if you find any difference between MT4 and Zorro Testing.

Re: Please, help with Fractal indicator. [Re: SFF] #414761
01/07/13 13:55
01/07/13 13:55
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Even with precisely the same indicators, there can be great differences between brokers and their platforms. The first obvious reason is that the price history is broker dependent, which can greatly affect the signals when using short time frames below 60 minutes. The second reason is that your 5 minute bars, even when based on the same price ticks, might start at a different time offset.

For testing this, compare the price charts and print also the highs and lows of the 5 bars belonging to the fractals, on both platforms. Then you can most likely see where the differences come from.

Re: Please, help with Fractal indicator. [Re: jcl] #414763
01/07/13 14:06
01/07/13 14:06
Joined: Jan 2013
Posts: 26
Italy
M
Maruska Offline OP
Newbie
Maruska  Offline OP
Newbie
M

Joined: Jan 2013
Posts: 26
Italy
I have tryed this experiment:

function run()
{
BarPeriod = 5;

printf("\n\nOpen = %.5f", priceOpen(1));
printf("\n\nClose = %.5f", priceClose(1));
printf("\n\nHigh = %.5f", priceHigh(1));
printf("\n\nLow = %.5f", priceLow(1));
}

and then I have start the Trade.

Zorro prints out these values for the last candle:

Open = 1.30517
Close = 1.30603
High = 1.30616
Low = 1.30609

but on the Trading Station for the same real account (that to witch zorro is connected), the last candle shows these values:

Open = 1.30579
Close = 1.30592
High = 1.30645
Low = 1.30569

Why zorro reads different price value from the same Broker and same account?
This leaves me a little dubious.
Maybe I missed something?

Last edited by Maruska; 01/07/13 14:13.
Page 1 of 4 1 2 3 4

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1