|
2 registered members (Akow, tomaslolo),
1,536
guests, and 12
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: How to shift any MAs
[Re: jcl]
#414161
12/24/12 11:19
12/24/12 11:19
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
|
|
|
Re: How to shift any MAs
[Re: SFF]
#416658
02/03/13 00:00
02/03/13 00:00
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
Joined: Nov 2012
Posts: 209
|
Hi, I made this script which I use shift but it doesn't work.
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: jcl]
#416811
02/05/13 01:04
02/05/13 01:04
|
Joined: Nov 2012
Posts: 209
SFF
OP
Member
|
OP
Member
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.
|
|
|
|
|
|