Rank: Newbie
Groups: Registered, Registered Users Joined: 8/19/2013(UTC) Posts: 4
|
request help in building an indicator which plots MACD of relative strength. So if i am comparing stock1 with stock2 it should plot the macd of relative strength of stock 1 with respect to stock 2...
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
Create a composite security: A-B make the relative strength of that RSI(A-B,Per1); make the MACD of that then make the signal of that Code:
Per1:=Input("Length RSI",10,100,14);
Per2:=Input("Length Fast MA",10,100,12);
Per3:=Input("Length Slow MA",10,100,26);
Per4:=Input("Length Signal",1,100,9);
A:=Security("C:\MData\IBM",C);
B:=Security("C:\MData\SPX",C);
D:=RSI(A-B,Per1);
F:=Mov(D,per2,S)-Mov(D,Per3,S);
FS:=Mov(F,Per4,S);
F;FS;
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 8/19/2013(UTC) Posts: 4
|
Henry thanks for your reply
i mean relative strength comparative and not RSI. Please advise
Grateful
|
|
|
|
Rank: Newbie
Groups: Registered, Registered Users Joined: 8/19/2013(UTC) Posts: 4
|
also is there any way to browse and pick security a and security b from a c drive folder to create the composite security
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
I think this is what you are looking for Code:
Per1:=Input("Length Fast MA",10,100,12);
Per2:=Input("Length Slow MA",10,100,26);
Per3:=Input("Length Signal",1,100,9);
A:=Security("C:\MData\IBM",C);
B:=Security("C:\MData\SPX",C);
F:=Mov(A/B,per1,S)-Mov(A/B,Per2,S);
FS:=Mov(F,Per3,S);
F;FS;
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 10/29/2004(UTC) Posts: 1,394 Location: Glastonbury, CT
Was thanked: 2 time(s) in 2 post(s)
|
You could change line f to
F:=Mov(C/B,Per1,S)- Mov(C/B,Per2,S);
You can also create an input to select different indexes to compare
Sec:=input("1=spx 2=dow 3=nas",1,3,1); Sec:=if(Sec=1,Security("C:\MData\Spx",C). if(Sec=2,Security("C:\MData\DJA",C). Security("C:\MData\QQQ",C)));
|
|
|
|
Users browsing this topic |
Guest (Hidden)
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.