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

[amibroker] buyprice/open problem



PureBytes Links

Trading Reference Links

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

*********************************
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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/