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

[amibroker] Re: How to limit number of trades per day?



PureBytes Links

Trading Reference Links


Hi,

After trying different things without success, I resorted to emailing
support. They quickly came back with an answer that works well for me.

======
Buy = //your rules here
Sell = //your rules here

Daystart = DateNum() != Ref( DateNum(),-1);
Buy = Buy AND Sum(Buy, BarsSince(Daystart) )==1 ;
======

Hope that is useful to someone else.
It was very interesting to use addcolumns and see how the different
components of the above formula work to end up with the final result.

Many thanks to the support dept!


--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <amibroker@xxxx>
wrote:
> Hello,
> 
> Yes I am listening and pyramiding is coming relatively soon (should
be here by February)
> 
> As for 
> >> Once I've set the upper and lower limits, how do I limit AB to
one
> >> long (with one sell) and one short trade (with one cover) per
day?
> 
> If you mean that you don't want to enter short trade if there was
one-bar long
> trade then, how about this simple code:
> 
> buy=...
> sell=...
> short=...
> cover=..your rules...
> 
> short = short AND NOT buy; // do not enter short when there was a
buy.
> 
> 
> If you meant that you don't want to enter more than one long and
one short trade in one bar
> - then such limit is already built-in.
> 
> If you do not want single-bar trades at all then just go to the
settings and turn
> OFF "allow same bar exit (single bar trade)" flag.
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "dbirru" <dbjunk@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, December 16, 2004 4:10 AM
> Subject: [amibroker] Re: How to limit number of trades per day?
> 
> 
> > 
> > 
> > I have asked the same question before and did not get an answer.
> > Now, I understand that you cannot do it in AB. I wounder if AB
folks
> > can listen to this and improve the portifolio testing feature. 
> > Among other things you cannot do are   like averaging up
(pyramiding)
> > and partial selling. 
> > 
> > 
> > 
> > --- In amibroker@xxxxxxxxxxxxxxx, "firehorse888uk"
> > <firehorse888uk@xxxx> wrote:
> >> 
> >> Hi,
> >> 
> >> I'm in the process of writing some intraday breakout code.
> >> 
> >> Once I've set the upper and lower limits, how do I limit AB to
one
> >> long (with one sell) and one short trade (with one cover) per
day?
> >> 
> >> Thanks
> > 
> > 
> > 
> > 
> > 
> > 
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> > 
> > Check group FAQ at: http://groups.yahoo.com/gr
oup/amibroker/files/groupfaq.html 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/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/