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.
|