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

Re: [amibroker] Re: Code help requested - Control length of trade



PureBytes Links

Trading Reference Links


Tomasz's betas aren't like MS betas  - they 
can be expected to work better than the previous version.  You can always 
follow the suggestions and backup the previous version before updating.  I 
confess to becoming complacent with the Wiz's consistent demonstrated 
competences!
 
Cheers,
 
 
Richard
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
<A title=greg.bean@xxxx 
href="">greg 
To: <A title=amibroker@xxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx 
Sent: Sunday, April 21, 2002 6:02 
PM
Subject: Re: [amibroker] Re: Code help 
requested - Control length of trade

Thanks, Mark. I wasn't going to update to most 
recent beta ... thought I would wait for V4.0 . I'm a little apprehensive 
about betas in general. Well, as they say "No guts, No glory" ! I've just 
learned a valueable lesson. " Don't fear to tred where Tomasz has led" . Sorry 
to be so "corny" . Gettin with it , got the beta.
 
Thanks,
Greg 
<BLOCKQUOTE 
>
----- Original Message ----- 
<DIV 
>From: 
MarkF2 

To: <A title=amibroker@xxxxxxxxxxxx 
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Sunday, April 21, 2002 7:07 
PM
Subject: [amibroker] Re: Code help 
requested - Control length of trade
Greg-  When you have the potential for multiple 
signals, the best way to control trade length is with the ExRemSpan 
function that Tomasz recently introduced.  The function syntaxis 
explained in the beta notes.  Here's an example.  Let's say 
you always want to sell after 10 bars.Buy = Your buy 
rules;Buy = ExRemSpan(Buy, 10);Sell = Ref(Buy, 
-10);Mark--- In amibroker@xxxx, "greg" 
<greg.bean@xxxx> wrote:> Ken,> > Thanks for 
bringing me back to that   "    sell = 
Ref(Buy,-20)    " I had tried it previously but something 
I had done was blocking it.  The sell = Ref(Buy,-20)   
statement works for me sometimes and then not at other times. I've got 
to leave this for awhile, and think about it later. I can't think 
anymore at this point.Thanks for your help> > 
Greg>   ----- Original Message ----- >   
From: Ken Close >   To: amibroker@xxxx >   
Sent: Sunday, April 21, 2002 12:47 PM>   Subject: RE: 
[amibroker] Code help requested - Control length of trade> 
> >   Greg: I was thinking that your original 
statement> >   sell = Ref(Buy,-20) rather than what 
you tried sell = Ref(Buy,20);> >   Did you ever try 
this?> >   Ken>   -----Original 
Message----->   From: greg 
[mailto:greg.bean@xxxx]>   Sent: Sunday, April 21, 2002 
10:02 AM>   To: amibroker@xxxx>   Subject: 
Re: [amibroker] Code help requested - Control length of trade> 
> >   Hi,> >   I think I've 
got it now. My use of ExRem was messing me up. > >   
This seems to work ok.> >   /* MI Screens 
BackTest*/> >   //Buy at open on first Monday Of 
Month //> >   Buyday = DayOfWeek()==1 AND 
Day()>=1 AND Day()<=7; // buy on Monday> 
>   //Sell on Friday, 4 weeks after buy//> 
>   Sellday = DayOfWeek()==5 AND Day()>=21 AND 
Day()<=31;//sell on friday> >   Buy=Buyday 
;> >   Sell= Sellday; // sell on Friday 20 days 
after buy> > > >   
//ApplyStop(2,3,Optimize("TrailingStop",15,0,20,5),1);> > 
> >   Greg> > > > 
> > > >     ----- Original 
Message ----- >     From: greg 
>     To: AmiBroker@xxxx 
>     Sent: Sunday, April 21, 2002 10:12 
AM>     Subject: [amibroker] Code help requested 
- Control length of trade> > 
>     Hi,> 
>     Been trying a few things for the past 3 
hours but can't seem to get it right. Please help before I get divorced 
:) .>     Trade Rules:> 
>     1. Buy at open on first monday of 
month.>     2. Sell at open on Friday 4 weeks 
later (sell after 28 days). That's sell after 20 bars . I think 
?> >     Pretty simple. But I guess I'm 
even more simple:( > >     I've 
tried   sell=ref(buy,20). 
>                    
sell = barssince(buy)=20> >     and 
various other tthings, but I'm getting nowhere.> 
>     Here's what I've got so far.> 
>     /* MI Screens BackTest*/> 
>     //Buy at open on first Monday Of Month 
//> >     Buyday = DayOfWeek() == 1; // 
buy on Monday> >     //Sell on Friday, 4 
weeks after buy//> >     Sellday = 
DayOfWeek()==5;//sell on friday> >     
Buy=Buyday ;> >     Sell=Sellday+20; // 
sell on Friday 20 days after buy> >     
//ApplyStop(2,3,Optimize("TrailingStop",15,0,20,5),1);> 
>     Buy=ExRem(Buy,Sell);> 
>     Sell=ExRem(Buy,Sell);> > 
> > > > > 
>     Your use of Yahoo! Groups is subject to the 
Yahoo! Terms of Service. > > > >   
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. 
> >         Yahoo! 
Groups Sponsor 
>               
ADVERTISEMENT>              
>        
>        > 
>   Your use of Yahoo! Groups is subject to the Yahoo! 
Terms of Service.Your use of Yahoo! Groupsis 
subject to the Yahoo! Terms of 
Service. Your 
use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service.