PureBytes Links
Trading Reference Links
|
In the help file under datenum:
10000 * (year - 1900) + 100 * month + day
So, dec04 2004 == 1041204
--
Terry
> From: das300@xxxxxxxxxx
> Reply-To: amibroker@xxxxxxxxxxxxxxx
> Date: Wed, 08 Dec 2004 03:29:33 -0000
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: Exit on specific date.
>
>
>
> If datenum() converts date to number then how do we know what say
> dec04 2004 is as a number ?
> Wouldnt we need to know this to say create params easily with date ?
>
> I experimented a while back but couldnt work it all out
>
> Regards
> moz
>
>
>
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, kaveman perth <kavemanperth@xxxx> wrote:
>> try this
>> Sell= Ref(EMA(C,30),-1) > EMA(C,30) or cross(datenum(),1041201);
>>
>> you could also have cross for the first buy/sell conditions
>> Sell= cross(ref(EMA(C,30),-1), EMA(C,30)) or cross(datenum(),1041201);
>> which will cut down on the number of extraneous signals
>>
>>
>> On Tue, 07 Dec 2004 22:32:36 -0000, traderkeith2000
>> <kosborn3@xxxx> wrote:
>>>
>>>
>>> Hi, the following is a simple crossover system. I would like to add to
>>> the sell line a condition that not only sells on the EMA cross but
>>> also on a specific date such as 1-dec-2004.
>>>
>>> I want to do this so there is no open positions at the end of the
>>> backtest period.
>>>
>>> Regards and thanks......Keith
>>>
>>> Plot(C,"Close Price", colorRed,styleBar);
>>> Plot(EMA(C,30),"EMA - 30 Period",colorYellow,styleLine);
>>>
>>> Buy = EMA(C,30) > Ref(EMA(C,30),-1);
>>> Sell= Ref(EMA(C,30),-1) > EMA(C,30);
>>>
>>> Buy = ExRem(Buy,Sell);
>>> Sell = ExRem(Sell,Buy);
>>>
>>> PlotShapes(shapeUpArrow*Buy+shapeDownArrow*Sell,
>>> IIf(Buy,colorBrightGreen,colorYellow));
>>>
>>>
>>> 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
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> Cheers
>> Graham
>> http://e-wire.net.au/~eb_kavan/
>
>
>
>
>
>
> 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
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
|