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

Re: [amibroker] Re: Adding R-multiple to backtest



PureBytes Links

Trading Reference Links



Thank you,

That plus using a dummy AddToComposite symbol in order to pass the ATR to the backtester solved my problem.

Nick
 
On Apr 11, 2009, at 9:55 PM, Mike wrote:



Adding R-Multiple is provided as an example in the user guide.

http://www.amibroker.com/guide/a_custommetrics.html

Mike

--- In amibroker@xxxxxxxxxps.com, Nick Willemse <nick.willemse@...> wrote:
>
> Hi Everyone,
> 
> I've been playing around with AB for awhile now and getting the hang 
> of working with arrays.
> 
> Now, i'm trying to add van tharp's r-multiple for each trade on the 
> backtester detailed report. R-multiple is trade profit divided by 
> initial trade risk. But I am having problems as to how to add it. I 
> am playing with the custom backtester, but how I can reference the 
> array that stores my initial trade risk values from the backtester?
> 
> My current backtester code looks like this and is just for debugging 
> purposes so far. The output shows that MaxStopLoss[bar] is always 
> zero even though I've assigned it above this code:-
> 
> else if(AAAction == actionPortfolio)
> {
> bo = GetBacktesterObject();
> bo.PreProcess(); // Initialize backtester
> for( bar=0; bar < BarCount; bar++)
> {
> bo.ProcessTradeSignals( bar );
> for ( sig=bo.GetFirstSignal(bar); sig; sig=bo.GetNextSignal(bar) )
> {
> if (sig.isExit())
> {
> _TRACE("ENTRY: " + sig.symbol + "@" + sig.Price + " stop @ " + 
> MaxStopLoss[bar]);
> //code need to go here to calc r-mul: trade_profit / 
> maxstoploss[at_trade_entry]
> }
> }
> }
> bo.PostProcess(); // Finalize backtester
> }
> 
> Any help appreciated
> 
> Nick
>




__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___