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

[amibroker] Scaling to Achieve Target Value on Close (Custom Backtester)


  • Date: Sat, 12 Dec 2009 01:07:10 -0000
  • From: "david.weilmuenster" <dweilmuenster95125@xxxxxxxxx>
  • Subject: [amibroker] Scaling to Achieve Target Value on Close (Custom Backtester)

PureBytes Links

Trading Reference Links

I am testing a system in which one particular position is scaled in/out daily to achieve a given target value on the Close.  The results of my scaling aren't as accurate as the test requires.

I am using the custom backtester and start the scaling after executing all other entry/exit signals and after calling updatestats(bar,1).

At that point, I find the open position to be scaled (call it openpos) and use openpos.getpositionvalue() to determine the current value of that postiion.

Last, I scale the position with:

bo.scaletrade	
(bar, 
openpos.symbol, 
new _value > openpos.getpositionvalue(),
openpos.getprice(bar,â??câ??),
abs(new_ value - openpos.getpositionvalue()
);

where new_value is the target value for the position on the Close and comes from calculations earlier in the test.

The actual value of the position after the Close (and updatestats(bar,2)) is usually different from new_value by something in the range of +/- 2%.  This is with roundlotsize and commissions set to zero, and a very largin margin allowance so that the position is not capped.

That's not bad, but probably not good enough for the purpose of this test.

Any suggestions on how to hone the scaling so that I get within +/- 0.5% of the target value?


Thanks,
David








------------------------------------

**** 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/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    amibroker-digest@xxxxxxxxxxxxxxx 
    amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/