logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
anthonyaj  
#1 Posted : Monday, September 4, 2023 9:06:12 AM(UTC)
anthonyaj

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/13/2018(UTC)
Posts: 12
Location: Perth

Was thanked: 3 time(s) in 3 post(s)

Hello,

I have pasted the RVI formula below but I am wondering if someone can show me how I create a symbol when the green trigger line (value 1) crosses the red line (value 2).

ti:=Input("length",2,20,10);

v1:=((C-O)+(2*Ref(C-O,-1))+(2*Ref(C-O,-2))+Ref(C-O,-3))/6;

v2:=((H-L)+(2*Ref(H-L,-1))+(2*Ref(H-L,-2))+Ref(H-L,-3))/6;

temp:=If(Sum(v2,ti)=0,0.0001,Sum(v2,ti));

rv:=Sum(v1,ti)/temp;

rvsig:= (rv+Ref(2*rv,-1)+Ref(2*rv,-2)+Ref(rv,-3))/6;

rv;

I have tried but I just cannot get it.

Any help appreciated.

Regards,

Anthony

MS Support  
#2 Posted : Tuesday, September 5, 2023 4:49:14 PM(UTC)
MS Support

Rank: Advanced Member

Groups: Moderators, Registered, Registered Users, Subscribers
Joined: 10/8/2010(UTC)
Posts: 1,934

Thanks: 85 times
Was thanked: 154 time(s) in 150 post(s)
Originally Posted by: anthonyaj Go to Quoted Post

Hello,

I have pasted the RVI formula below but I am wondering if someone can show me how I create a symbol when the green trigger line (value 1) crosses the red line (value 2).

ti:=Input("length",2,20,10);

v1:=((C-O)+(2*Ref(C-O,-1))+(2*Ref(C-O,-2))+Ref(C-O,-3))/6;

v2:=((H-L)+(2*Ref(H-L,-1))+(2*Ref(H-L,-2))+Ref(H-L,-3))/6;

temp:=If(Sum(v2,ti)=0,0.0001,Sum(v2,ti));

rv:=Sum(v1,ti)/temp;

rvsig:= (rv+Ref(2*rv,-1)+Ref(2*rv,-2)+Ref(rv,-3))/6;

rv;

I have tried but I just cannot get it.

Any help appreciated.

Regards,

Anthony

Hello,

It appears your formula only has one output "rv". Are you wanting to use the Expert Advisor to put a symbol on your chart when RV crosses above/below RVSIG? You could have a single expert symbol for this, or you could have an expert symbol for the cross above and another symbol for the cross below.

You would have to modify the formula to replace the "Input" function in your "ti" variable. The Input function will not work within the Expert Advisor, but you could modify the formula to simply refer to a fixed variable value (which you could adjust as desired). For example, if you create a New Expert Advisor, you can click on the Symbols tab and click New to create a New Symbol:

Name: Cross Up

Condition:

Code:
ti:=10;
v1:=((C-O)+(2*Ref(C-O,-1))+(2*Ref(C-O,-2))+Ref(C-O,-3))/6;
v2:=((H-L)+(2*Ref(H-L,-1))+(2*Ref(H-L,-2))+Ref(H-L,-3))/6;
temp:=If(Sum(v2,ti)=0,0.0001,Sum(v2,ti));
rv:=Sum(v1,ti)/temp;
rvsig:= (rv+Ref(2*rv,-1)+Ref(2*rv,-2)+Ref(rv,-3))/6;
Cross(rv,rvsig)

Set the Graphic Tab to a Buy Arrow (Green) with Symbol Position and Label Position set to "Below" then click OK. Click New again.

Name: Cross Down

Condition:

Code:
ti:=10;
v1:=((C-O)+(2*Ref(C-O,-1))+(2*Ref(C-O,-2))+Ref(C-O,-3))/6;
v2:=((H-L)+(2*Ref(H-L,-1))+(2*Ref(H-L,-2))+Ref(H-L,-3))/6;
temp:=If(Sum(v2,ti)=0,0.0001,Sum(v2,ti));
rv:=Sum(v1,ti)/temp;
rvsig:= (rv+Ref(2*rv,-1)+Ref(2*rv,-2)+Ref(rv,-3))/6;
Cross(rvsig,rv)

Set the Graphic Tab to a Sell Arrow (Red) with Symbol Position and Label Position set to "Above" then click OK. Open the Expert Advisor, locate your new Expert and Attach it to the chart.

anthonyaj  
#3 Posted : Tuesday, September 5, 2023 11:03:30 PM(UTC)
anthonyaj

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/13/2018(UTC)
Posts: 12
Location: Perth

Was thanked: 3 time(s) in 3 post(s)

Hello,

Thank you for the response. I initially just wanted the cross up but I will do both seeing as though you have supplied both.

Thank you, I will try it out and let you know how it goes.

Regards,

Anthony

thanks 1 user thanked anthonyaj for this useful post.
MS Support on 9/6/2023(UTC)
anthonyaj  
#4 Posted : Wednesday, September 6, 2023 12:06:44 AM(UTC)
anthonyaj

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 11/13/2018(UTC)
Posts: 12
Location: Perth

Was thanked: 3 time(s) in 3 post(s)

Worked perfectly, thank you.

thanks 1 user thanked anthonyaj for this useful post.
MS Support on 9/6/2023(UTC)
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.