Rank: Newbie
Groups: Registered, Registered Users Joined: 2/9/2007(UTC) Posts: 1
|
Formula Assistance, Expert Advisor:
I am stumped trying to write a formula for an Alert in Expert Advisor. The complete formula I am looking for is “Price falls in heaviest volume since breakout.” I can handle the rest of the formula but need help finding the highest volume since a specific date and can enter the date manually.
I have tried variations of the following example:
{Date inputs}
StDay:=Input("start Day",1,31,1);
StMnth:=Input("start Month",1,12,1);
StYear:=Input("start Year",1800,2200,2005);
{Selected date signal}
date:=Year()>StYear
OR (Year()=StYear AND (Month()>StMnth
OR Month()=StMnth AND DayOfMonth()>=StDay));
{Most recent day's volume is greater than volume since breakout}
V>(HHV(V,(date)))
But these formulas either are either not allowed in an Expert Advisor or constant data is required.
I am hoping there is some alternative way to provide an Alert of highest volume since a specific date in Expert Advisor.
Thanks
Steve2007
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers, Unverified Users Joined: 10/28/2004(UTC) Posts: 3,111 Location: Perth, Western Australia
Was thanked: 16 time(s) in 16 post(s)
|
Steve, Dont use the Input function in the Advisor, you have to set the dates manually:
Code:
{Date inputs}
StDay:=1;
StMnth:=1;
StYear:=2005;
{Selected date signal}
date:=Year()>StYear
OR (Year()=StYear AND (Month()>StMnth
OR Month()=StMnth AND DayOfMonth()>=StDay));
{Most recent day's volume is greater than volume since breakout}
V>(HHV(V,(date)))
Of course, you will have to manually update the date information every time you need to change the date, which can be painful or lead to errors if you have forgotten to update the right information. (A lesson I learned the hard way!)
If the date is 'global variable' you might consider storing it in another function and using the FmlVar() to call the value from the expert, function or exploration? Hope this helps. wabbit [:D]
|
|
|
|
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.