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

Re: [amibroker] Re: Resetting exRem at the start of the day



PureBytes Links

Trading Reference Links

Title: Normal.dot Template
Cross() always returns an array it is in the guide:
 

CROSS
- crossover check

Trading system toolbox


SYNTAX cross( ARRAY1, ARRAY2 )
RETURNS ARRAY
FUNCTION Gives a "+1" or true on the day that ARRAY1 crosses above ARRAY2. Otherwise the result is "0".
To find out when ARRAY1 crosses below ARRAY2, use the formula cross(ARRAY2, ARRAY1)
EXAMPLE cross( close, ema(close,9) )
SEE ALSO  

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: J. Biran
Sent: Wednesday, February 02, 2005 9:15 AM
Subject: RE: [amibroker] Re: Resetting exRem at the start of the day

The help on cross does not clarify:

Gives a "+1" or true on the day that ARRAY1 crosses above ARRAY2.
Otherwise the result is "0".

 

What happens when the 2 signals cross each other more then once?
(wouldn’t the result be an array with 0,1,0,0,0,1,… ?)



Joseph Biran
____________________________________________

 


From: Graham [mailto:kavemanperth@xxxxxxxxx]
Sent: Monday, January 31, 2005 1:37 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Re: Resetting exRem at the start of the day

 

Cross will provide a single signal when the variable value crosses
above the other value. This provides a single signal for buy/sell
rather than using > which will provide a continuous series of signals
every bar that the value is higher than the other

Using exrem is useful for backtesting and charts, but does not remove
the excess signals from scans or explorations


On Mon, 31 Jan 2005 16:17:19 -0000, qweds_560 <qweds_560@xxxxxxxxx> wrote:
>
>
> Thanks Graham, tried it,doesn't solve the problem...
>
> In general, does using CROSS take out excessive signals without
> using exRem?
>
> Sam
>
> --- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxxx> wrote:
> > try
> > x=Cross(TimeNum(), 093001);
> >
> >
> > On Fri, 28 Jan 2005 13:08:53 -0000, qweds_560 <qweds_560@xxxx>
> wrote:
> > >
> > >
> > > Hi,
> > >
> > > I am using the following code to try and reset exRem at the
> > > beginning of the day:
> > >
> > > x=TimeNum() == 093000;
> > >
> > > Buy = ExRem(Buy,Short);
> > > Sell = ExRem(Sell,Buy);
> > >
> > > Short = ExRem(Short,Buy);
> > > Cover = ExRem(Cover,Short);
> > >
> > > Short=IIf(x==1,Flip(Short,Buy),Short);
> > > Buy=IIf(x==1,Flip(Buy,Short),Buy);
> > >
> > > This sort of gives me a solution in that, while it now gives me
> all
> > > the trades i want, there may be an extra trade at 093000 which I
> > > then need to delete manually from my analysis.
> > >
> > > Any suggestions on improving on my solution?
> > >
> > > Thanks
> > >
> > > Sam
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "qweds_560" <qweds_560@xxxx>
> wrote:
> > > >
> > > > Thanks for this, this solves my previous problem of trades not
> > > > closing at a specified time if there is no data there! (I just
> > > > needed to >= rather than = the time).
> > > >
> > > > Unfortunately, I still cannot make the backtester reset at the
> > > > beginning of the day. I am now trying to use if...else
> statements.
> > > >
> > > > Any suggestions appreciated.
> > > >
> > > > Sam
> > > >
> > > > --- In amibroker@xxxxxxxxxxxxxxx, "Herman van den Bergen"
> > > > <psytek@xxxx> wrote:
> > > > > Try to close out positions at the end of the day (untested)
> with
> > > > something
> > > > > like this:
> > > > >
> > > > > MarketClose= 155000; // set to suit your needs and TF used
> > > > > EndOfDayPeriod = Timenum() >= MarketClose;
> > > > >
> > > > > Sell = sell or EndOfDayPeriod ;             // exit on last
> bar
> > > > > cover = cover or EndOfDayPeriod ;
> > > > >
> > > > > Buy = buy and not EndOfDayPeriod;     // no entries on last
> bar
> > > > > Short = short and not EndOfDayPeriod ;
> > > > >
> > > > > herman
> > > > >   -----Original Message-----
> > > > >   From: qweds_560 [mailto:qweds_560@xxxx]
> > > > >   Sent: Sunday, January 23, 2005 3:00 PM
> > > > >   To: amibroker@xxxxxxxxxxxxxxx
> > > > >   Subject: [amibroker] Resetting exRem at the start of the
> day
> > > > >
> > > > >
> > > > >
> > > > >   Hello,
> > > > >
> > > > >   I am backtesting on an intraday basis. I am using a system
> > > which
> > > > >   alternates between long and short positions. All positions
> are
> > > > >   closed out at the end of the day. I seemed to have coded
> this
> > > so
> > > > far
> > > > >   using exRem to remove any excessive signals.
> > > > >
> > > > >   At present, the backtester will continue alternating into
> the
> > > > next
> > > > >   day by referring to the last trade made on the previous
> day.
> > > For
> > > > >   example, if the last trade today was a short position
> (which
> > > > will be
> > > > >   closed at the end of the day), the backtester will monitor
> for
> > > a
> > > > buy
> > > > >   signal the next day.
> > > > >
> > > > >   I need to reset it somehow so that the backtester monitors
> for
> > > > >   either a buy OR a short signal at the start of the next day
> > > (at a
> > > > >   specified time) without reference to the last trade of the
> > > > previous
> > > > >   day.
> > > > >
> > > > >   I would be grateful for any suggestions on how to do this.
> > > > >
> > > > >   Many thanks
> > > > >
> > > > >   Sam




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