Gamestudio Links
Zorro Links
Newest Posts
Alternative to Stooq for Zorro S
by cwford. 10/09/26 21:13
Stooq now requires an API key
by cwford. 10/08/26 23:27
ZorroGPT
by TipmyPip. 10/06/26 05:32
Purchase A8 full licence version
by jcl. 10/05/26 12:12
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
0 registered members (), 26,922 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
JimSimons, julienp, julienper, KelleyAbbey, Yopachi
19246 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Doubt on accesing indicator previous values!! Anyone can help? #468857
10/23/17 19:05
10/23/17 19:05
Joined: Oct 2017
Posts: 10
O
Oligon Offline OP
Newbie
Oligon  Offline OP
Newbie
O

Joined: Oct 2017
Posts: 10
Hello everyone!

I'm very excited to try Zorro, however I'm having some trouble to figure out how can I access previous values of the ZigZag indicator. For example if I want to get the rPeak value but 2 values before the current value, how would I approach it? I know rPeak is a global var type, but how can I access for example rPeak(2)?

Thanks so much in advance for anyone that could point me in the right direction!!

Re: Doubt on accesing indicator previous values!! Anyone can help? [Re: Oligon] #468867
10/24/17 06:39
10/24/17 06:39
Joined: Feb 2017
Posts: 369
D
Dalla Offline
Senior Member
Dalla  Offline
Senior Member
D

Joined: Feb 2017
Posts: 369
Try rPeak[2]

Re: Doubt on accesing indicator previous values!! Anyone can help? [Re: Dalla] #468868
10/24/17 07:31
10/24/17 07:31
Joined: Jul 2000
Posts: 28,140
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 28,140
Frankfurt
For getting old rPeak values, store them when a new peak appears, i.e. when rPeak becomes smaller.

Code:
static int Peak1 = 99999, Peak2, Peak3;

ZigZag(....);
if(rPeak < Peak1) {
  Peak3 = Peak2+1;
  Peak2 = Peak1+1;
  Peak1 = rPeak;
} else {
  Peak3++;
  Peak2++;
  Peak1++;
}





Re: Doubt on accesing indicator previous values!! Anyone can help? [Re: Dalla] #468874
10/24/17 20:37
10/24/17 20:37
Joined: Oct 2017
Posts: 10
O
Oligon Offline OP
Newbie
Oligon  Offline OP
Newbie
O

Joined: Oct 2017
Posts: 10
Thank you so much!!

Re: Doubt on accesing indicator previous values!! Anyone can help? [Re: jcl] #468875
10/24/17 20:37
10/24/17 20:37
Joined: Oct 2017
Posts: 10
O
Oligon Offline OP
Newbie
Oligon  Offline OP
Newbie
O

Joined: Oct 2017
Posts: 10
Thanks JCL! Will try that!


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1