Rank: Member
Groups: Registered, Registered Users Joined: 5/22/2006(UTC) Posts: 27
|
Hi All
Im stuck calling my ExtFml("StrategyAlert.Alert", "Strat001.Buy") when my Expert Advisor says so.
The example is for when two moving averages cross I want to call my external formula that passes it on to by broker. The condition for the advisor is:-
Cross(Mov(c, 5, w), Mov(c, 20, w))
Any help would be much appreciated.
YachtFund
|
|
|
|
Rank: Advanced Member
Groups: Registered, Registered Users, Subscribers Joined: 3/7/2005(UTC) Posts: 1,346
|
hey yachtfund..... you mentioned 'passes it on to by broker'...... the expert would send the Strat001.Buy when your conditions are met, ie the moving average cross....
that's part of the experts alert ..... alert options allow for sending emails, pages and such to your broker or whomever..... the contents of that email could include the ExtFml("StrategyAlert.Alert", "Strat001.Buy") or perhaps just the decoded plain text instructions..... such as.... buy 2000 'csco' limit 16.75 ......
if your trying to create a system test which calls a "Strat001.Buy", obviously the method would be different....h
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/22/2006(UTC) Posts: 27
|
Hi H
Thanks for the reply. What I want is Metastock to create a signal and through ExtFml send the trade details to my DLL, which then sends that to my VB app that sorts out positions size etc and then send that to the broker.
I have the VB app and the connection to my broker. I also have the Expert Advisor showing symbols on my charts what I cant for the life of me do is when the symbol apears on my chart, call the ExtFml.
I also only want it to call the ExtFml when it has crossed and not while its crossing.
Thanks
YF
|
|
|
|
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)
|
YF,
One of the though processes that you need to overcome is that every function is fully evaluated for every bar. This means that you cannot say something like:
If my entry condition is met, call the external formula, else do not call the external formula.
MS computes both conditions on every bar. So what you have to do is send the value of your condition to the external formula and 'switch case' it there.
MSFL code...
x:=ExtFml("myFunction.RingMyBroker", Entry);
Function code...
if(Entry==1) then ring my broker else return nothing end if
Hope this helps.
wabbit.
P.S. I know the example is the not the best, so if you need a better explanation please just get in contact with me.
|
|
|
|
Rank: Member
Groups: Registered, Registered Users Joined: 5/22/2006(UTC) Posts: 27
|
wabbit, thanks as always.
|
|
|
|
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.