Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, Quad, EternallyCurious, 1 invisible), 737 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
rSign of ZigZag indicator flipped #480536
06/13/20 16:21
06/13/20 16:21
Joined: May 2020
Posts: 27
Germany
M
Morris Offline OP
Newbie
Morris  Offline OP
Newbie
M

Joined: May 2020
Posts: 27
Germany
This might also be a documentation issue -- either way, it appears to me that the rSign variable generated by ZigZag() has the wrong sign. From the online manual for ZigZag():

Quote
Returned: rSlope (the slope of the last identified line; upwards lines have a positive slope, downwards lines a negative slope); rPeak (the bar offset of the last identified peak); rSign (1 if the last peak was a top, -1 if the last peak was a bottom); rLength (the number of bars of the last zig or zag that ends with rPeak)


Unless I misinterpret this, rSlope and rSign should always have the same sign; however, they have opposite signs (in Zorro S 2.25), and rSign appears to contain -1 for a prior top, and 1 for a prior peak. rSlope appears correct. I assume this could be fixed by changing either the documentation (for backwards compatibility) or the implementation...

Re: rSign of ZigZag indicator flipped [Re: Morris] #480563
06/15/20 14:17
06/15/20 14:17
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
I would interpret it so that rSlope and rSign have a different sign. If the last peak was a top, then rSign is 1, and rSlope is negative because the slope goes downwards from a top.

Re: rSign of ZigZag indicator flipped [Re: jcl] #480566
06/15/20 17:52
06/15/20 17:52
Joined: May 2020
Posts: 27
Germany
M
Morris Offline OP
Newbie
Morris  Offline OP
Newbie
M

Joined: May 2020
Posts: 27
Germany
Well, I understand one could interpret it that way -- only, that's not what rSign actually does :-)

Code
void run()
{
    StartDate = 2016;
    EndDate = 2016;
    BarPeriod = 1440;

    ZigZag(series(price()), 150*PIP, 1, DARKGREEN);
    plot("rSign", rSign, NEW, RED);
}


Yields the attached result. It appears that as soon as rSign recognizes that a new leg is being formed, it assumes -1 for a prior top and 1 for a prior bottom (as seen by the length of the legs in the image, and by the last value for rSign)...

In any case. Not a big deal, one just has to be aware of it either way.

Attached Files EURUSD-ZigZag.png
Re: rSign of ZigZag indicator flipped [Re: Morris] #480580
06/17/20 09:28
06/17/20 09:28
Joined: Jul 2000
Posts: 27,982
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,982
Frankfurt
Ok, we'll check what rSign really does and will make the documentation more clear.

Re: rSign of ZigZag indicator flipped [Re: Morris] #480602
06/17/20 16:33
06/17/20 16:33
Joined: May 2020
Posts: 27
Germany
M
Morris Offline OP
Newbie
Morris  Offline OP
Newbie
M

Joined: May 2020
Posts: 27
Germany
Thank you! smile


Moderated by  jcl, Nems, Spirit, Tobias 

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