Gamestudio Links
Zorro Links
Newest Posts
Access Denied with Zorro S
by German. 06/24/21 14:42
EXITRUN for TRADE
by jcl. 06/24/21 10:09
BarOffset for per-bar oversampling
by Sempervirens. 06/24/21 02:39
Players Health
by rayp. 06/23/21 19:04
Acknex-Configuration
by 3run. 06/21/21 16:39
AUM Magazine
Latest Screens
Hecknex World
Scheherazade's Journey
Paradox Vector
The Space Between
Who's Online Now
8 registered members (RealSerious3D, German, AndrewAMD, Sempervirens, x34v, 3run, 2 invisible), 441 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Bonobo791, damasceno, peterr991, fx2201, adaptivetrader
18657 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,536
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

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

Chief Engineer
jcl  Offline

Chief Engineer

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