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

[amibroker] Re: combining two conditions for buy or sell signals


  • Date: Sun, 14 Mar 2010 01:47:09 -0000
  • From: "bistrader" <bistrader@xxxxxxxxx>
  • Subject: [amibroker] Re: combining two conditions for buy or sell signals

PureBytes Links

Trading Reference Links

Might want to use Flip on Condition1 and 3 prior to ANDing. Say have cross today, but MA20 is still going down.  Then, the next day MA is trending up, but condition1 has already crossed.  Sorry, no buy signal.  So, am thinking Flip.

--- In amibroker@xxxxxxxxxxxxxxx, "Joris Schuller" <jschuller@xxx> wrote:
>
> MA5=MA(C,5); 
> MA20=MA(C,20); 
> Condition1=Cross(MA5,MA20); 
> Condition2=MA20>Ref(MA20,-1); 
> Condition3=Cross(MA20,MA5); 
> Condition4=MA20<Ref(MA20,-1); 
> Buy= Condition1 AND Condition2; 
> Sell= Condition3 AND Condition4; 
> shape = Buy * shapeUpArrow + Sell * shapeDownArrow;//No same day buy sell
> possible 
> Plot( Close, "Price", colorBlack, styleCandle ); 
> Plot(MA5,"MA5",colorGreen,5); 
> Plot(MA20,"MA20",colorRed,5); 
> PlotShapes( shape, IIf( Buy, colorGreen, colorRed ), 0, IIf( Buy, Low, High
> ) );;
> 
>  
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of rijnaars
> Sent: Saturday, March 13, 2010 7:13 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] combining two conditions for buy or sell signals
> 
>  
> 
>   
> 
> if i want a buy signal for instance when the MA 5 is crossing MA 20 zone 
> but only want this buy signal when the MA is crossing a rising MA 20 
> in upwards direction.
> 
> So not only must MA5 croos upwards but also must the MA 20 be rising
> 
> how do i make this buy condition??
>




------------------------------------

**** 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/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/