Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, SBGuy), 987 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 2 1 2
How to shift any MAs #413942
12/20/12 06:33
12/20/12 06:33
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
Hi,

I don't find any idea to do it from the help.
Could you do it? How?

I mean that both +/- shift here.

Thanks in advance.

Re: How to shift any MAs [Re: SFF] #413946
12/20/12 08:24
12/20/12 08:24
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Well, I can certainly understand that people want a -/+ shift. If someone showed me how to do a negative shift of an MA, I could give up all work and would be obscenely rich.

A positive shift however is pretty simple, just add +n to the series. This is explained in Workshop 4.

Re: How to shift any MAs [Re: jcl] #414095
12/22/12 20:57
12/22/12 20:57
Joined: Sep 2012
Posts: 74
Niedersachsen, Germany
P
PriNova Offline
Junior Member
PriNova  Offline
Junior Member
P

Joined: Sep 2012
Posts: 74
Niedersachsen, Germany
what @SFF mean is to shift the values forth or back. the same like in the ichimoku indicator or like it is possible with mt4.

so it is possible to shift the values in the desired direction. it doesn't have to do with value forecasting.

Re: How to shift any MAs [Re: PriNova] #414104
12/23/12 08:02
12/23/12 08:02
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
I understood what he meant.

Re: How to shift any MAs [Re: jcl] #414161
12/24/12 11:19
12/24/12 11:19
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
Thanks, I will try.

Re: How to shift any MAs [Re: SFF] #416658
02/03/13 00:00
02/03/13 00:00
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
Hi,

I made this script which I use shift but it doesn't work.

Code:
vars close_price = series(priceClose());
vars Buy1_1 = series(SMA(series(priceClose()),14));
vars Buy1_2 = series(SMA(series(priceClose()),28));

if(Buy1_1-1 < Buy1_2-1 && Buy1_1 > Buy1_2 )
enterLong();
if(Buy1_1-1 > Buy1_2-1 && Buy1_1 < Buy1_2)
enterShort();



As you know, I want to shift series -1 which is a normal shift strategy.

Could you correct this code?

Re: How to shift any MAs [Re: SFF] #416753
02/04/13 09:27
02/04/13 09:27
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Mankind's technology is still not ready to time travel. You can shift series into the past, but not into the future.

I could tell you a trick how to do it nevertheless, but there is no use of any shift in your code anyway. I guess you just want a crossover. You can find the crossOver function in the manual - there's also an example that just looks as your code should probably look.

http://manual.zorro-trader.com/crossover.htm

Re: How to shift any MAs [Re: jcl] #416811
02/05/13 01:04
02/05/13 01:04
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
Thank you for your reply.
Yes, I know crossover compares [1] and [0] in series but it is not what I need.

What I mean is I want to use DMA.

Here it is for more info.
http://strategy4forex.com/forex-strategi...verage-dma.html

Last edited by SFF; 02/05/13 01:06.
Re: How to shift any MAs [Re: SFF] #416825
02/05/13 10:00
02/05/13 10:00
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
Ok, I see now what you want to do. That is just a delayed SMA.

You could shift the series into the past by adding +n, or even simpler, just calculate the SMA from a delayed price:

vars Buy1_1 = series(SMA(series(priceClose(n)),14));

n is the displacement.

Re: How to shift any MAs [Re: jcl] #416826
02/05/13 10:05
02/05/13 10:05
Joined: Nov 2012
Posts: 209
S
SFF Offline OP
Member
SFF  Offline OP
Member
S

Joined: Nov 2012
Posts: 209
Great, I will try. Thank you.

Page 1 of 2 1 2

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