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

[amibroker] AlertIf giving too many sell alerts



PureBytes Links

Trading Reference Links


I am exploring the alertif function and am having a problem. I only 
want the alert if the sell is actually triggered fof the current day, 
however the following code, from the AA window, gives a sell alert 
for every symbol in my portfolio unless there is a buy signal that 
day. Any ideas what I am doing wrong. TIA.

Tom


ADXPerLong =  Optimize("ADXPerLong", 25, 5, 25, 5);
FixedStop = Optimize ("fixed loss stop", 5, 5, 30, 5);
RSIhigh =  Optimize("RSI High", 70, 70, 90, 5);

PositionSize = 5000; 
Filter = 1;

Buy = ADX() >= ADXPerLong AND ADX() >= HHV(ADX(),10) AND C >= HHV
(C,10) AND RSI() < RSIhigh;
Short = 0;

Sell = Ref(ADX(),-10) > ADX() AND ADX() < ADXPerLong;
Cover = 0;

ApplyStop(stopTypeLoss, stopModePercent, FixedStop, 1, True, 1);

BuyPrice = C - ATR(14)/2;
ShortPrice = C + ATR(14)/2;
AlertIf( Buy,"",FullName(),1 );
AlertIf( Sell,"",FullName(),2 );






------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

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