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

RE: [amibroker] Short signals not triggering.



PureBytes Links

Trading Reference Links

Never mind this. I figured out I needed to specify "Long and Short" in
settings.   Still have one question however:  What is the performance hit
coding systems in AFL using looks (For, While) as opposed to the Array based
processing.

Thanks again

-----Original Message-----
From: Dimension [mailto:dimension@xxxxxxxxxxxxx] 
Sent: Wednesday, November 10, 2004 7:37 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Short signals not triggering.


Hi,
I am unable to figure out why by short trades are not executing.  I am
trying to do the following.
-If the price closes TWO consecutive days above the BBand(20), short.
-If the price closes THREE consecutive days below the BBand(20), go long
-Exit when the Middle band (MA(20)) is crossed.  

The code I am using is below.  Also, is there a performance hit if I were to
code this using a For loop instead of the Array based functions?
I find I can think about things more clearly if I can iterate thru the bars.


SHORT_BARS = 2;
LONG_BARS = 3;
PER = 20;
STD_DEV = 2;

vBBTop = BBandTop( C, PER, STD_DEV);
vBBBot = BBandBot( C, PER, STD_DEV);
vBBMid = MA( C, 20 );

shortSig = SUM( C > vBBTop, SHORT_BARS ) == SHORT_BARS ;
longSig = SUM( C < vBBBot, LONG_BARS) == LONG_BARS;
exitSig = iif(shortSig, C < vBBMid, C > vBBMid);

Buy = longSig;
Short = shortSig;
Sell = exitSig ;
Cover = exitSig ;


[Non-text portions of this message have been removed]




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



 





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/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/