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

Re: [amibroker] cannot buy on open



PureBytes Links

Trading Reference Links

Hi Graham,

Forget that condition, Graham.  I want a buy condition that is met on
every open, and a sell condition that is met on every close.  Can you
do it?  If you can, maybe I can tweak it from there.  I cannot do it.

Yuki

Sunday, February 23, 2003, 10:47:39 AM, you wrote:

G> Yuki
G> Buy requires a condition to be met and results in a binary 1 or 0. A "1"
G> gives the signal for the buy to be activated.
G> Same with the Sell
G> So you would need a condition to be met :
G> Buy = Cross(C,EMA(C,20);
G> Sell = Cross(EMA(C,10),C);
G> BuyPrice = Open;
G> SellPrice = Close;
G> Now you need to apply the settings to buy at open, and sell at close.
G> Then have your trade delays set to what you require, Buy delay 0 day,
G> and sell at 0 days. You can do this with the command
G> SetTradeDelays(0,0,0,0);

G> Check if these are the correct spellings in the AB help pages. Hope this
G> works, I have not tested it but will if you have problems with it, or
G> maybe someone else will have  abetter response.

G> Oh, by the way, do not consider your questions sill or basic because
G> often they make me stop and think about things and how I can improve my
G> coding.

G> Cheers,
G> Graham
 

G> -----Original Message-----
G> From: Yuki Taga [mailto:yukitaga@xxxxxxxxxxxxx] 
G> Sent: Sunday, 23 February 2003 9:18 AM
G> To: amibroker@xxxxxxxxxxxxxxx
G> Subject: [amibroker] cannot buy on open

G> Sometimes the apparently simplest things are not, in AB.

G> I cannot seem to make it buy on the open and sell on the close the
G> same day, no matter what formula I enter.  Everything is done on the
G> close.  This is regardless of what I have in 'settings', and
G> regardless of what I write in code to control those settings.

G> Even a brain-dead:

G> Buy = Open; //nothing more, we'd buy every open and sell every close

G> Sell = Close;

G> SetTradeDelays(0,0,0,0);

G> BuyPrice = Open;

G> SellPrice = Close;

G> results in all buys and sells taking place on the close, at the same
G> price, of course. Can someone explain why I cannot control this?

G> Yuki ^_^


Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/