Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (VoroneTZ, monk12, Quad), 829 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
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