Gamestudio Links
Zorro Links
Newest Posts
Why Zorro supports up to 72 cores?
by 11honza11. 04/26/24 08:55
M1 Oversampling
by 11honza11. 04/26/24 08:32
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Data from CSV not parsed correctly
by EternallyCurious. 04/25/24 10:20
Trading Journey
by howardR. 04/24/24 20:04
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, VoroneTZ, Quad, 1 invisible), 837 guests, and 5 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
ROC function needed #478286
09/28/19 15:43
09/28/19 15:43
Joined: Mar 2019
Posts: 22
S
Smallz Offline OP
Newbie
Smallz  Offline OP
Newbie
S

Joined: Mar 2019
Posts: 22
Hi guys

I want to create a new trading system.

Part of it needs an RoC (Rate of Change function), which is based on the simple moving average.

For example, we want to understand how much % the MA (50) has changed over the last 5 bars on GBPUSD. If the value on bar 1 has been 1.30100 and the value on bar 5 is 1.29600, then the rate of change would be -500 ticks, or -0.38%.
If the value on bar 1 has been 1.30100 and the value on bar 5 is 1.30600, then the rate of change would be 500 ticks, or +0.38%


I should be able to use it the SMA function, so the code would look like below

vars RoCvalues = series(RoC(SMA(Price,50),5));

How can I implement this?

Re: ROC function needed [Re: Smallz] #478289
09/28/19 16:38
09/28/19 16:38
Joined: Feb 2017
Posts: 1,725
Chicago
AndrewAMD Online
Serious User
AndrewAMD  Online
Serious User

Joined: Feb 2017
Posts: 1,725
Chicago
SMA() needs a vars, but you supplied a var. Make a series for it.

ROC is an existing function in all caps. Lite-C is case sensitive.

ROC() needs a vars, but you supplied a var. Make a series for it.

Note that the manual tells you all of the requirements of these functions. Definitely give it a read.

Re: ROC function needed [Re: AndrewAMD] #478293
09/28/19 18:11
09/28/19 18:11
Joined: Mar 2019
Posts: 22
S
Smallz Offline OP
Newbie
Smallz  Offline OP
Newbie
S

Joined: Mar 2019
Posts: 22
Originally Posted by AndrewAMD
SMA() needs a vars, but you supplied a var. Make a series for it.

ROC is an existing function in all caps. Lite-C is case sensitive.

ROC() needs a vars, but you supplied a var. Make a series for it.

Note that the manual tells you all of the requirements of these functions. Definitely give it a read.


Thanks Andrew. Much appreciate the quick reply.


Moderated by  Petra 

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