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

Re: [amibroker] buyprice/open problem



PureBytes Links

Trading Reference Links

hi,
 
what you need to do is define your Buy rule like:
 
Buy = Cond1 AND Cond2 ... etc;
 
then in the Buyprice you define as:
 
BuyPrice = MAX(0.25 * Ref(ATR(45),-1) + Ref(L,-1),O);
 
regards, Ed
 
 
 
 
----- Original Message -----
Sent: Thursday, January 01, 2009 4:56 PM
Subject: [amibroker] buyprice/open problem

Hello,

I am trying to test a trading system and I am running into a slight
problem. I am wanting to take yesterdays low + 0.25 * ref(atr(45),-1)
to come up with a buyprice.

If todays open is below the buyprice and todays high is above the
buyprice everything works as planned. However, if todays open is
above the buyprice instead of going long at the open (which is what I
want to do) I am going long at the low of the day, which is
impossible. Here is my code.

BuyPrice = 0.25 * Ref(ATR(45),-1) + Ref(L,-1);

Buy=IIf(Cond1 AND Cond2 AND O > BuyPrice, Open,IIf(cond1 AND cond2 AND
O < BuyPrice AND H > BuyPrice,BuyPrice,0));

What I am trying to get this to do is if today at the open is above
the buyprice I have set to enter long at the open, otherwise if
today's open is below the buyprice and today's high is above the
buyprice go long at the buyprice.

can someone take a look and help me out? Thanks
Eric

__._,_.___

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

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

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

For other support material please check also:
http://www.amibroker.com/support.html

*********************************




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

__,_._,___