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

RE: [amibroker] Is there a WAIT-type function?



PureBytes Links

Trading Reference Links

There are Time and Date functions to allow making decisions wrt date&time. For example DateNum(), TimeNum(), Now(), Minutes(), Seconds(), etc.
 
To know tomorrow whether a condition was true during a previous run you can use StaticVariables, see StaticVarSet() and StaticVarGet(). These variables will retain their values regardles of whether you shut down and power up your compurter. For example to know that you started a new day you could use NewDay = DateNum() != ref(DateNum(),01);
 
There are also ParamDate() and ParamTime() function that allow you to manually change the Date/Time parameters for your conditions.
 
best regards,
herman
 
-----Original Message-----
From: Andrew Z [mailto:wizard@xxxxxxxxxxxxxxx]
Sent: Monday, February 07, 2005 6:18 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Is there a WAIT-type function?

G'day all,

My code includes a section where if a condition is met today, I need it
to wait until tomorrow's close, compare to previous day and either
execute a buy or discard and move on. In the real world, i'd say this is
simple enough to do because all i'd need to do is set my condition to
alert me if it is met. I then wait a day and at EOD I can make my
comparison and either enter the trade or discard it. But how can i
simulate this in a back test?? How can i code a delay or a wait until
tomorrow for my comparison to occur?

Any help will be greatly appreciated.

Andrew.


Check AmiBroker web page at:
http://www.amibroker.com/

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




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