Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (AndrewAMD, dBc, clonman, TipmyPip), 18,735 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 28,024
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,024
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 | 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