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

Re: [amibroker] Sell == 4



PureBytes Links

Trading Reference Links




Hello,
 
The code you refer to was posted by one of AmiBroker 
users.
It was in the "comments" section. 
 

1.  Did my result match the intended one?
YES, because code produces spike when exit by trailing stop was 
generated and
your trailing stops are triggered rarely
 
2.  Could one not get a similar result by displaying the 
buy/sell arrows?
Yes, but sell arrows are the same regardless of what was the 
reason
of sell (regular signal or stop-generated signal).
And the code referred to visualising only stops.
Instead one would use also PlotShapes function that is better for 
that purpose.
 
 
3.  In the Plot(Sell == 4,....................) 
statement, do I interpret it correctly to mean:  Plot  the value of 4 
if the value of Sell equals 4?
 
Yes, but value 4 is assigned by Equity( 1 ) when trailing stop is 
triggered. 
So it in fact means plot Spike when trailing stop is 
triggered,
 
4.  I am comfortable with the concept that Sell can hold 
the values of 0 or 1, indicating False/True.  Where does the
    value of 4 come from?  I could not 
find any reference in Help or group messages.
 
In fact any NON zero value is treated as True and zero is treated 
as False.
The value 4 is written back to sell/cover arrays by Equity(1 ) 
function.
see also <A 
href="">http://www.amibroker.com/guide/afl/afl_view.php?name=EQUITY
 
 
5. If Sell can hold the value 4, can it also hold the values 
of 2 or 3 or 5,.........?  If so, what are the meaning of the 
    different values and where can one find the 
reference?
Yes it can hold any numerical value,
1 - regular exit
2 - max loss stop
3 - profit target stop
4 - trailing stop
5 - ruin stop (loosing more than 99.9% of equity)
 
6.  I do not understand the need for the Equity statement 
above.  Can someone explain?
Equity( 1 ) is a special form of Equity() call that 
allows to write back signals generated
by ApplyStop to sell/cover 
arrays.
<A 
href="">http://www.amibroker.com/guide/afl/afl_view.php?name=EQUITY
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Tony/Dianne 

  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">Amibroker Group 
  Sent: Friday, March 28, 2003 3:33 
PM
  Subject: [amibroker] Sell == 4
  
  Hello,
   
  I am relatively new at using the AA part of AB.  I've 
  been able to code a formula to do what I wished and
  felt that the ApplyStop function was what I needed.  In 
  reviewing the documentation for ApplyStop, I noted
  the following:
   
  For visual conformation of ApplyStop function, 
  add the following lines below your ApplyStop formula in Indicator 
  Builder:Equity(1); // THIS EVALUATES STOPSPlot(Sell==4,"ApplyStop 
  Sell",colorRed,1|styleOwnScale);Plot(Cover==4,"ApplyStop 
  Cover",colorGreen,1|styleOwnScale);
   
  I included the code in IB and got a result that was a flat 
  red line with a spike at the sell point then continuing
  the flat red line.
   
  My questions are:
   
  1.  Did my result match the intended one?
  2.  Could one not get a similar result by displaying 
  the buy/sell arrows?
  3.  In the Plot(Sell == 4,....................) 
  statement, do I interpret it correctly to mean:  Plot  the value of 
  4 if the value of Sell equals 4?
  4.  I am comfortable with the concept that Sell can 
  hold the values of 0 or 1, indicating False/True.  Where does 
  the
      value of 4 come from?  I could not 
  find any reference in Help or group messages.
  5. If Sell can hold the value 4, can it also hold the values 
  of 2 or 3 or 5,.........?  If so, what are the meaning of the 
  
      different values and where can one find 
  the reference?
  6.  I do not understand the need for the Equity 
  statement above.  Can someone explain?
   
  I have some other questions on the ApplyStop function, but 
  will hold that for another post.
   
  Regards,
   
  TonySend 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT









Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.