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

[amibroker] Embedding custom information in Signal arrays


  • To: "AmiBroker YahooGroups" <amibroker@xxxxxxxxxxxxxxx>
  • Subject: [amibroker] Embedding custom information in Signal arrays
  • From: "Herman van den Bergen" <psytek@xxxxxxxx>
  • Date: Tue, 14 Sep 2004 17:27:07 -0400

PureBytes Links

Trading Reference Links

We have no custom capability in Backtest reports however you can embed
additional information in the BackTesters "Trade" column.

For example when writing loops to implement custom stops it can become quite
tedious to debug Out-of-PriceBounds errors. Normally Exploration Reports are
used to debug code however you have to shuffle back and forth between Chart,
TradeList and Exploration results to match dates with trades and find them
on the charts.

As signal arrays containing anything greater than 1 are TRUE regardless of
their value we can encode additional information in these arrays as long as
we don't change any 0s (zeroes) into values greater than 0 (zero). As an
example the code below modifies the signal arrays to carry additional error
information. In this case signal array value for trades that contain
out-of-bound errors are increased by 10 and are easily identifiable in the
"trade" column of the tradelist - without the need for explorations. Right
click on the trade and you will see arrows on your chart where the problem
is.

Modifying the signal arrays you can embed an unlimited number conditions
that will be directly visible in the backtest report by simply adding
positive integers, for example by adding 10, 20, 100, 200, etc. Lacking
custom columns in the backtester this may fill the need for such in some
cases.

herman.

// ... your systems code here
BuyT = BuyPrice <= Low OR BuyPrice >= High;
SellT = SellPrice < Low OR SellPrice > High;
ShortT =ShortPrice < Low OR ShortPrice > High;
CoverT = CoverPrice < Low OR CoverPrice > High;
error = BuyT OR SellT OR ShortT OR CoverT;
for( i = 0; i < BarCount ; i++ )
{
if(BuyT[i] AND Buy[i] ) Buy[i] = Buy[i] +10;
if(SellT[i] AND Sell[i] ) Sell[i] = Sell[i] +10;
if(ShortT[i] AND Short[i] )Short[i] = Short[i] +10;
if(CoverT[i] AND Cover[i] ) Cover[i] = Cover[i] +10;
}


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> 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:
    http://docs.yahoo.com/info/terms/