Now I’m trying to code Amibroker in Custom Backtester Interface mode. After I’ve read pdf file, I found that the property in trade object that I can write my own information is MarginLoan.
So my question is "Is amibroker have another empty object in Custom Backtester Interface mode that I can assign my own information or it just have only Marginloan property? "
Will appreciate it very much if you please guide about the ideal place to remove the StaticVariable
"StaticVarSet( Name() + “ATR”, ATR( 15 ) )" in your example.
So that unnecessary resources are not used. (May be - you may want to update the example).
Sumangalam,
I spent the past few days working with custom metrics for the first time. They allow you to insert values into your Backtest Trade Report for each and every trade!.
The example Tomasz provides above works perfectly. Set up a sandbox.afl and copy and run the sample code.
I believe you can replace “ATR” with whatever “Column Heading” you like, and ATR(15) with just about any calculation you like. If you haven’t already, I suggest you read up on how Static Variables work.
One tidbit I found somewhat burried in the documentation is that each static variable contains timestamps automatically added. Using trade.entrydate you can retrieve the static variables value at that exact point in time.
Perhaps someone else can better explain or provide a link that explains the contents of static variables.