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

Re: [amibroker] Re: A few questions for QP2 users


  • To: <amibroker@xxxxxxxxxxxxxxx>
  • Subject: [amibroker] Debugging Stops/Exits (Was:Detecting Cause Of Trade EXIT...)
  • From: "Herman van den Bergen" <psytek@xxxxxxxx>
  • Date: Sun, 4 Jul 2004 06:32:28 -0700

PureBytes Links

Trading Reference Links




You 
can use the AmiBroker charting capability to make debugging stops a lot 
easier. I added these statements to my Equity(1) statement in my system's code. 
It will help you understand how SetTradeDelays(), AllowSameBarExits and 
ActivateStopsImmediately effect you trading signals. Especially when debugging 
PortFolioTrading systems this may be helpful.<SPAN 
class=890375412-04072004>
DigitsOn = Param("Stop Digits 
On",0,0,1,1);if<FONT 
color=#000000>(DigitsOn)     {<FONT 
face="Lucida Console">    AddToComposite<FONT 
face="Lucida Console">(Sell,<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"C",<FONT 
face="Lucida Console">1|<FONT 
face="Lucida Console">2|<FONT 
face="Lucida Console">4|<FONT 
face="Lucida Console">8<FONT 
color=#000000>);<FONT 
face="Lucida Console">    AddToComposite<FONT 
face="Lucida Console">(Cover,<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"O",<FONT 
face="Lucida Console">1|<FONT 
face="Lucida Console">2|<FONT 
face="Lucida Console">4|<FONT 
face="Lucida Console">8<FONT 
color=#000000>);    
}
<FONT 
face=Arial>E = Equity(1); // This 
statement is part of you system's code
<SPAN 
class=890375412-04072004> 
if<FONT color=#000000 
size=2>(DigitsOn)     {<FONT 
size=2><FONT 
face="Lucida Console"> <FONT 
face="Lucida Console">    AddToComposite<FONT 
face="Lucida Console">(Sell,<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"H<FONT 
face="Lucida Console">",<FONT 
face="Lucida Console">1|<FONT 
face="Lucida Console">2|<FONT 
face="Lucida Console">4|<FONT 
face="Lucida Console">8<FONT 
color=#000000>);<FONT 
face="Lucida Console">    AddToComposite<FONT 
face="Lucida Console">(Cover,<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"L<FONT 
face="Lucida Console">",<FONT 
face="Lucida Console">1|<FONT 
face="Lucida Console">2|<FONT 
face="Lucida Console">4|<FONT 
face="Lucida Console">8<FONT 
color=#000000>);    
}
<FONT face=Arial color=#0000ff 
size=2> 
You 
turn on this code by setting DigitsOn to 1 using the AA Param() button. 
Next you place this code ahead of all code in your Built-In Price Indicator, 
similarly to the above code you turn it on with the Right-Click Param() 
function.

DigitsOn = Param("Digits 
On",0,0,1,1);if<FONT 
size=2>(DigitsOn) <SPAN 
class=890375412-04072004>         
{<SPAN 
class=890375412-04072004>    OS = Param("Digit 
OffSet",3,0,50,1<FONT 
face="Lucida Console" size=2>);<FONT 
size=2>    Sell = 
Foreign("~Signals"+Name(),"C"<FONT 
size=2>);<SPAN 
class=890375412-04072004>    Cover = <FONT 
face="Lucida Console">Foreign(<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"O"<FONT 
face="Lucida Console" color=#000000 size=2>);<SPAN 
class=890375412-04072004>    SellShapeDigitNum = 
IIf(Sell,33+2<FONT face="Lucida Console" color=#000000 
size=2>*Sell,shapeNone);<SPAN 
class=890375412-04072004>    CoverShapeDigitNum = 
IIf(Cover,33+2<FONT face="Lucida Console" color=#000000 
size=2>*Cover,shapeNone);<SPAN 
class=890375412-04072004>    
PlotShapes(CoverShapeDigitNum,colorBrightGreen,0,(1-OS/1000)*(H+L)/2<FONT 
face="Lucida Console" color=#000000 size=2>);<SPAN 
class=890375412-04072004>    
PlotShapes(SellShapeDigitNum,colorRed,0,(1-OS/1000)*(H+L)/2<FONT 
size=2>);<SPAN 
class=890375412-04072004>    Sell = <FONT 
face="Lucida Console">Foreign(<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"H"<FONT 
size=2>);<SPAN 
class=890375412-04072004>    Cover = <FONT 
face="Lucida Console">Foreign(<FONT 
face="Lucida Console">"~Signals"+<FONT 
face="Lucida Console">Name(),<FONT 
face="Lucida Console">"L"<FONT 
face="Lucida Console" color=#000000 size=2>);<SPAN 
class=890375412-04072004>    SellShapeDigitNum = 
IIf(Sell,33+2<FONT face="Lucida Console" color=#000000 
size=2>*Sell,shapeNone);<SPAN 
class=890375412-04072004>    CoverShapeDigitNum = 
IIf(Cover,33+2<FONT face="Lucida Console" color=#000000 
size=2>*Cover,shapeNone);<SPAN 
class=890375412-04072004>    
PlotShapes(CoverShapeDigitNum,colorBlue,0,(1+OS/1000)*(H+L)/2<FONT 
face="Lucida Console" color=#000000 size=2>);<SPAN 
class=890375412-04072004>    
PlotShapes(SellShapeDigitNum,colorYellow,0,(1+OS/1000)*(H+L)/2<FONT 
size=2><FONT 
face="Lucida Console">);<SPAN 
class=890375412-04072004>        
 }
Enable and Position 
the Digits with Param() of the price Chart. Your Price Chart should look 
like this with both DigitsOn set to 1:
<IMG alt="" hspace=0 
src="jpg00087.jpg" align=baseline border=0>
Modify to your specific needs. 
Good luck,
<FONT 
size=2>herman.


Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












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 the Yahoo! Terms of Service.






Attachment: Description: ""