Error

 Previous Topic Next Topic
 anthonyaj #1 Posted : Monday, September 4, 2023 9:06:12 AM(UTC) Rank: MemberGroups: Registered, Registered Users, SubscribersJoined: 11/13/2018(UTC)Posts: 12Location: PerthWas 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
 Wanna join the discussion?! Login to your Discussions forum accountor Register a new forum account.
 MS Support #2 Posted : Tuesday, September 5, 2023 4:49:14 PM(UTC) Rank: Advanced MemberGroups: Moderators, Registered, Registered Users, SubscribersJoined: 10/8/2010(UTC)Posts: 1,900Thanks: 84 timesWas thanked: 150 time(s) in 146 post(s) Originally Posted by: anthonyaj 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 UpCondition: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 DownCondition: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) Rank: MemberGroups: Registered, Registered Users, SubscribersJoined: 11/13/2018(UTC)Posts: 12Location: PerthWas 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 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) Rank: MemberGroups: Registered, Registered Users, SubscribersJoined: 11/13/2018(UTC)Posts: 12Location: PerthWas thanked: 3 time(s) in 3 post(s) Worked perfectly, thank you. 1 user thanked anthonyaj for this useful post. MS Support on 9/6/2023(UTC)
 Users browsing this topic
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.