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

Notification

Icon
Error

Options
Go to last post Go to first unread
Frenkys  
#1 Posted : Wednesday, January 1, 2014 2:29:47 PM(UTC)
Frenkys

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/4/2010(UTC)
Posts: 12

Hello everyone, as in other threads read i have the problem with the alerts of expert advisor with the notifications that are repeated continuously and sending many e-mails.
The code i use is this,,,, intraday time frame 15 minutes:

BUY:

Buy:=Fml("My HMA Centrata 128-16-32")>Ref(Fml("My HMA Centrata 128-16-32"),-1);

Sell:=Fml("My HMA Centrata 128-16-32")<Ref(Fml("My HMA Centrata 128-16-32"),-1);

buy AND BarsSince(Ref(buy,-1))>BarsSince(Ref(sell,-1));

SELL:

Sell:=Fml("My HMA Centrata 128-16-32")<Ref(Fml("My HMA Centrata 128-16-32"),-1);

Buy:=Fml("My HMA Centrata 128-16-32")>Ref(Fml("My HMA Centrata 128-16-32"),-1);

sell AND BarsSince(Ref(buy,-1))<BarsSince(Ref(sell,-1))

I have a latch becouse otherwise the signals of buy and sell are repeated and i have read in other threads that i can use a latch in way to trigger once on each buy - sell notifications

I do not know very well the different latch that can be used in different cases, and i do not know how to use them

help
MS Support  
#2 Posted : Thursday, January 2, 2014 11:49:25 AM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 52 times
Was thanked: 130 time(s) in 126 post(s)
It is hard to say definitively whether this would work with your formulas or not, but aside from disabling the Recalculate Expert Live feature (which makes it so that the formulas only calculate at the end of the price bar), you could try using the Cross function instead of using greater than / less than, such as:

Buy:=Cross(Fml("My HMA Centrata 128-16-32"),Ref(Fml("My HMA Centrata 128-16-32"),-1));

Sell:=Cross(Ref(Fml("My HMA Centrata 128-16-32"),-1),Fml("My HMA Centrata 128-16-32"));

buy AND BarsSince(Ref(buy,-1))>BarsSince(Ref(sell,-1));
Frenkys  
#3 Posted : Friday, January 3, 2014 7:21:03 AM(UTC)
Frenkys

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/4/2010(UTC)
Posts: 12

Thanks for the quick reply.

I know the possibility of disabling the function of recalculate expert live but i wanted to avoid using even because is general for all expert.
I try the modified code that you wrote and then tell you if it's okay.

Thanks
Frenkys  
#4 Posted : Wednesday, January 8, 2014 11:13:38 AM(UTC)
Frenkys

Rank: Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/4/2010(UTC)
Posts: 12

I tried changing the code as written you but the result is very similar to the code that I used.
I have disabled the function of recalculate expert live but is a little tedious to enable and disable this function for some expert and others do not.
The function of recalculate expert live should be included in the expert editor and not in general options, I hope to be done in future versions of metastock.

Thank you
MS Support  
#5 Posted : Wednesday, January 8, 2014 11:35:24 AM(UTC)
MS Support

Rank: Advanced Member

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

Thanks: 52 times
Was thanked: 130 time(s) in 126 post(s)
One thing to keep in mind, if the value crosses up and you get an alert, it can still cross back down, then cross back up again triggering a new alert. Depending on how easily the values cross each other, it may not help that much.

The feedback is appreciated!
John S  
#6 Posted : Tuesday, January 14, 2014 2:37:07 PM(UTC)
John S

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/9/2012(UTC)
Posts: 169

You may want to look at the Forum DLL in the Files section (click Files tab above). There is a Latch function therein that may do specifically what you need. I am not an expert on this DLL, but there are others here on the forum that have experience using this.
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.