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

Re: [amibroker] Re: Buy Statement


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: Re: [amibroker] Re: Buy Statement
  • From: "Tomasz Janeczko" <amibroker@xxxx>
  • Date: 20 Jun 2002 19:31:50 -0000
  • In-reply-to: <LNBBJBELJJHBCDDCAGNJKEDMDHAA.closeks@xxxx>

PureBytes Links

Trading Reference Links

Hello,

The answer is simple: these -180 spikes mark trades that were exited by max. loss stop.

It was in 3.99 updates when I added a new feature to the backtester (excerpt from the ReadMe):

"Backtester now reports the type of stop that exited the trade (max loss), (profit), (trail) - are added to mark trades that were
closed by max. loss stop, profit target stop and trailing stop respectively.
You can also mark your own reasons for exit by assigning numerical value
to sell, cover arrays:
1 - means normal exit, 2 - max loss, 3- profit target, 4-trailing stop,
5 - 9 reserved for future use (other types of built-in stops.
10 and above - custom exits labelled by Long (n) or Short(n) where n is a number > 10

Example:
cond1 = Cross( EMA( Close, 20 ), Close );
cond2 = Cross( Signal(), MACD() );
Buy = Cross( MACD(), 0 );
Sell = IIf( cond1, 10, IIf( cond2, 11, 0 ) );

"

So when a trade is exited by built-in stop backtester (or Equity() function) marks
it in the Sell (or Cover) array with appropriate number. For max. loss this is "2".

Thats why Plot(-90*Sell,"",4,4); gives -180 when trade was exited by max. loss stop
and -90 otherwise.

AmiBroker treats all non-zero values as "true" and only zero as "false".

If you want to plot constant height bars you have to use

Plot(-90* IsTrue( Sell ),"",4,4);



Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Ken Close" <closeks@xxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, June 19, 2002 3:07 PM
Subject: RE: [amibroker] Re: Buy Statement


> 
> 
> DT: speaking of truth table, please look closely at the attached. It shows
> the Sell statement being plotted as
> Plot(-90*SELL,"",4,4); and the nearby plot showing a spike to -180.
> 
> Why is this??
> 
> Notice the fourth red spike back in April only goes to -90 while the next
> three go to -180. I think the fourth back correct spike is a normal exit
> while the next three are stop loss exits. My stop loss is set to exit on
> 18% stop loss immediate. Could this be the reason??? and does it
> matter????
> 
> Ken
> 
> Marek,
> The only way to understand is the truth table.
> A B (A AND B) A*B
> 1 0 0 0
> 0 1 0 0
> 1 1 1 1
> 0 0 0 0
> If the truth table is the same [one by one] then the expressions are
> the same.
> We usually have a "common undrerstanding" of AND, but it is not
> always correct. We force our logic to create an understanding and
> sometimes we think it is OK. Unfortunately, the only correct output
> is the truth table.
> I did not suppose it is obvious, but it is better to know it.
> Thank you for your comments.
> Dimitris
> > > Logic teachers are always attractive persons.
> > > I will never forget the first lesson in math Logic.
> > > The teacher was walking in the classroom for 5 min repeating the
> > > phrase:
> > > Am I walking OR am I talking ? Am I walking OR am I talking ?
> >
> > AND ???;)
> >
> > Regards,
> > --
> > Marek Chlopek
> > Email: mchlopek@xxxx
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> 
> 
> 
> 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
>