PureBytes Links
Trading Reference Links
|
Sid, you are correct to use Now(4) or system time. If you use bar
time and there is no tick you will not close the trade when you
expect. AFL scans your code when a tick comes in. If a tick does not
come in at the end of the bar then you will not trade when you expect.
When you exit make sure you have a position before you send an order
to TWS. If numPositions == 0 do nothing, if < 0 cover (send buy
order) and if > 0 sell order.
If you are trying to close a position before the market closes give
yourself enough time to ensure that your system clock is not too far
behind TWS clock.
Barry
--- In amibroker@xxxxxxxxxxxxxxx, Rajiv Arya <rajivarya87@xxx> wrote:
>
>
> try this
> buytime = timenum()<=122900;
> selltime =timenum()>=124400;
> buycondition = cross(a,b);
> buy=buycondition and buytime;
>
> good luck
> Rajiv
>
> To: amibroker@xxxxxxxxxxxxxxx
> From: skbiker@xxx
> Date: Sun, 25 Jan 2009 10:39:03 -0800
> Subject: [amibroker] intraday time control
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> I need a little help in defining intraday time for
trading control.
>
> I want to prevent entries after 12:29 and exit positions after
12:44.
>
> This is what I have tried so far and it does not work: (conceptual
example)
>
> time = Now(4);
> Buy = Cross(A, B) AND time <= 1229;
> Short = Cross(B, A) AND time <= 1229;
> Sell = Cover = time >= 1244;
>
> Cheers, Sid
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> _________________________________________________________________
> Hotmail® goes where you go. On a PC, on the Web, on your phone.
> http://www.windowslive-
hotmail.com/learnmore/versatility.aspx#mobile?
ocid=TXT_TAGHM_WL_HM_versatility_121208
>
------------------------------------
**** 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/
|