[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] exrem flip for MA cross



PureBytes Links

Trading Reference Links



it is not perfect,
but I think it goes

MA1 = MA(C,12) ;
MA2 = MA(C,15) ;
MA3 = MA(C,20) ;

Condi1 = Flip( MA1 < MA2 AND MA1 < MA3 , MA1 > MA2 AND MA1 > MA3 );

Buy = MA1 > MA2 AND MA1 > MA3 AND Ref(Condi1,-1) ;
Sell = MA1 < MA2 OR MA1 < MA3 ;

Buy = ExRem (Buy,Sell);
Sell = ExRem(Sell,Buy);


mirobercik schrieb:

Hello,

I'm creating a 3 moving averages system.

MA1 fastest
MA2 slower
MA3 the slowest

It opens new position when MA1 crosses both MA2 & MA3 (order doesn't matter) and exits when crosses one of them again (from above or below depending on position).

Problem appears after exiting from position. The situation:
MA1 crosses MA2 & MA3 from below.Long position is opened. After some period MA1 crosses MA2 from above and position is closes. Couple bars later MA1 crosses MA2 again from below. I do not want to open Long position again. It first needs to cross 2 other MAs.

Summaring:
1. There can't be new long position opened after exiting from previous L.
(the same for S)
2. New position is opened when MA1 crosses MA2 & MA3 (order doesn't matter)
3. Position is closes when MA1 crosses MA2 or MA3.

That's a part of my system but I can't go further without it.

I know it can be done with exrem() or flip() but I don't understand these functions.

Please help,
Thanks!




__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___