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

[amibroker] Index Entry/Exit Rules


  • Date: Sat, 26 Dec 2009 04:45:45 -0000
  • From: "jollypolly999" <jollypolly999@xxxxxxxxx>
  • Subject: [amibroker] Index Entry/Exit Rules

PureBytes Links

Trading Reference Links

Hello, I would like to add a primary function to a simple system I am trialing. The rules shall determine if any stock can be traded. This is not a cross-over intialisation but IIF the Index conditions are met, then any stock within the universe will be traded with the main formula.
I don't know how to code this. It should start with a foreign function that addresses the Index like this. 

xao = Foreign("XAO", "Close");   

The trick is that either the EMA or the DEMA allow the stock trades and this is determined by one being above or below the other. This is the best I can explain it. The rules are as follows:

When  250 DEMA is below 250 EMA :

#1) Enter any positions when an XAO Index day bar closes above 250 DEMA 
#2) Exit all positions when an XAO Index day bar closes below 250 EMA

When 250 DEMA is above 250 EMA : 

#1) Enter any positions when an XAO Index day bar closes above 250 EMA
#2) Exit all positions when an XAO Index day bar closes below 250 DEMA






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

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