Rank: Advanced Member
Groups: Registered, Registered Users Joined: 4/27/2005(UTC) Posts: 130
|
Patrick,
How would you start off a formula if you wanted to get a cross from 3 different indicators with in 4 periods? Say you wanted to get a cross from the MACD, RSI and the final confirmation from a 5 and 20 day moving avg with in 4 periods?
|
|
|
|
Rank: Advanced Member
Groups ready for retrieval: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
CD1:=Cross1;
CD2:=Cross2;
CD3:=Cross3;
Alert(CD1,4) and Alert(CD2,4) and Alert(CD3,4)
Patrick :mrgreen:
|
|
|
|
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)
|
Just a friendly word of caution there Patrick and dieselpr,
The code checks for the cross condition in the last four days, but the condition might not still be true on the final bar. E.g The RSI could have crossed up on day one and dipped back below on any of days two - four and still be found by the code kindly provided by Patrick.
This is one of the drawbacks of using the alert method like Patrick has demonstrated. I prefer to use the Alert() method in a slightly different way, and many would have seen me use this code and wondered why....
CD1:=RSI>threahold and Alert(RSI<threshold,4);
CD2:=C>MA and Alert(C<MA,4);
CD1 and CD2 etc
This will return stocks that are still TRUE on the last day. You have to be very careful to understand EXACTLY what you are asking MS to do. Are you happy with just an event occurring some time during the period, or must the event happen and remain true?
Hope this helps.
wabbit :D
|
|
|
|
Rank: Advanced Member
Groups ready for retrieval: Registered, Registered Users, Subscribers Joined: 9/8/2004(UTC) Posts: 2,266
Was thanked: 1 time(s) in 1 post(s)
|
Damn you are picky :evil:
Alright I will admit that Wabbit is a 1000% right ... :oops:
Patrick :mrgreen:
|
|
|
|
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)
|
Not picky.... reflective. I got burned on this one some time ago.
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.