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

Notification

Icon
Error

Options
Go to last post Go to first unread
joshcr  
#1 Posted : Thursday, July 6, 2006 5:38:34 AM(UTC)
joshcr

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/19/2006(UTC)
Posts: 9
Location: USA

Is there a way to specify a signal to be triggered if my condition is true for say 60 seconds or more?
StorkBite  
#2 Posted : Thursday, July 6, 2006 12:47:40 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
What time frame are you trading? If on a one-minute RT basis, perhaps something like this: signal:=C<0.8247; a1:=Ref(signal,-1); signal AND a1 Also check out the Alert function. p.s., you'll have to change the signal criteria to meet your own needs.
joshcr  
#3 Posted : Thursday, July 6, 2006 3:42:11 PM(UTC)
joshcr

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/19/2006(UTC)
Posts: 9
Location: USA

i'm trading on a 5 minute chart and i want to enable the "Recalculate expert live" option however my criteria becomes true and false throughout the session and i'm thinking this will assist in my problem. This code using the previous session as timing which wouldn't work for what i'm trying to do on a 5min chart, correct? Is there a way to modify this? signal:=Cross(MACD(),Mov(MACD(),9,E)); a1:=Ref(signal,-1); <===== would be a 5 min session in my case right? signal AND a1
hayseed  
#4 Posted : Thursday, July 6, 2006 4:52:21 PM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey josh..... would a one bar delay work.... alerts will often times bounce in and out over the course or the most recent bar..... h [code:1:438ecbff80] signal:=Cross(MACD(),Mov(MACD(),9,E)); a1:=If(Ref(signal,-1)=1,1,0); a1[/code:1:438ecbff80]
joshcr  
#5 Posted : Thursday, July 6, 2006 5:39:49 PM(UTC)
joshcr

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/19/2006(UTC)
Posts: 9
Location: USA

Thanks hayseed... if i understand you correctly wouldn't that put me in a bad position for a particular trade? like if my signals crossed at 3:53:30 the signal would not go off until 3:55 correct?
joshcr  
#6 Posted : Thursday, July 6, 2006 5:43:52 PM(UTC)
joshcr

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/19/2006(UTC)
Posts: 9
Location: USA

what about this.. signal:=Cross(MACD(),Mov(MACD(),9,E)); a1:=Ref(signal,-.25); <===== does setting that to .25 mean 75 seconds on a 5 min chart? signal AND a1 i'm still seeing the signals activate and disappear during a session with this setting.
StorkBite  
#7 Posted : Thursday, July 6, 2006 6:41:06 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
The live bar will continue to change unless you turn off the feature in OPTIONS | REALTIME. I've been thinking about how else you might achieve the outcome, but I can't think of any way that is based upon a certain number of seconds. This possibly could be done with MSX. Also, you could do this outside of MS as part of a DDE application. Both would require the skills of a programmer. Using the Ref() function would delay your signals by whatever time period you are trading. i.e., a1:=Ref(signal,-1) would be 5 min in your example. In your example, your criterion is a crossover. That is plotted when the crossover occurs. You could extend it with the Alert function, but I don't see how that would help you. Maybe you want to combine conditions such as when the crossover has occurred and the macd() is higher than the average. Something like this might get you started: [code:1:9e9cc83fe5]a1:=MACD(); a2:=Mov(MACD(),9,E); up:=Cross(a1,a2); dn:=Cross(a2,a1); 0;If(up OR a1>=a2,1,If(dn OR a1<a2,-1,0));[/code:1:9e9cc83fe5] I tried to play around with counting how many times a live bar triggered my criteria. Then, if it happened xx number of times, give me a signal. I think it just showed volatility though. I didn't have much time to sort through it and it never quite worked the way I wanted. However, maybe something like this will help you: [code:1:9e9cc83fe5]cond1:= Cross(MACD(),Mov(MACD(),9,E)); signal:= If(cond1, ExtFml("GV.SetVar","Count", ExtFml("GV.GetVar","Count")+1), ExtFml("GV.GetVar","Count")-1); signal[/code:1:9e9cc83fe5] Then, if signal > xx, do something. Sorry for the delay in getting back to you. I think H said it though... look at the ref() function.
joshcr  
#8 Posted : Thursday, July 6, 2006 6:53:53 PM(UTC)
joshcr

Rank: Newbie

Groups: Registered, Registered Users
Joined: 6/19/2006(UTC)
Posts: 9
Location: USA

cool, thanks for the work you are putting into this, i really appreciate it. i'll work with the code right now and let you know the results. if this doesn't work is it possible to somehow combine data from the 1 min chart, namely the session closes, to plot my signals on a 5 min chart. i still want the MACD and MOV data to come from a 5 minute chart. Do you think this is possible? Also, is there anyone or even you that we could pay to help with this and maybe chat via phone? i think this would avoid confusion as i'm new to the code and don't know if i'm wording what i want correctly. thanks again for the help :D ============ regarding the above code i get the following error. "This DLL does not exist in the MSX DLL folder." Where do i get the MSX that you spoke of? Thanks!
StorkBite  
#9 Posted : Thursday, July 6, 2006 10:10:47 PM(UTC)
StorkBite

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 3/19/2005(UTC)
Posts: 2,995

Was thanked: 14 time(s) in 10 post(s)
Mark Pyle's gv.dll can be downloaded here: http://forum.equis.com/d..._file_view&cat=8&file=31 Find out more about the MS Developer's Kit here: https://www.metastock.com/partners/developers.aspx Our resident developers pick and choose their projects. I'm sure that this thread will be read, so hang on for possible responses. Make sure you read posts by MSTT regarding working with multiple time frames. You can do an author search and pray... (inside joke) Check out his website here: http://www.metastocktips.co.nz/ Also, Chris3105 has posted some of his multi-time frame work: http://forum.equis.com/viewtopic.php?t=2745 My counter theory may work, but my code is a complete bust. Check out MSTT's counter here: http://forum.equis.com/viewtopic.php?t=3958 Finally, don't forget that you can set up a layout to include multiple time frames... say, 1 min and 5 minute. Then you can add independent indicators to them and save. At the very least, you will have a visual reference right in front of you. You can read more on layouts in the User's Manual.
hayseed  
#10 Posted : Friday, July 7, 2006 3:12:35 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey josh.... it would put you one bar behind the trigger.... whether or not it puts you in a bad position for a particular trade is difficult to say.... i've ran system tests along that line of thinking, delaying 1 or more bars after the trigger..... the results are surprising....... is it the buy/sell symbols appearing and dissappearing that is bothering you or something else..... the true alerts can be annoying, i seldom use them now days...... have you tried binary waves set in histogram style....h
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.