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

[amibroker] Great!


  • Date: Tue, 12 Jan 2010 11:27:33 -0000
  • From: "Roman" <Roman.Tatkin@xxxxxxx>
  • Subject: [amibroker] Great!

PureBytes Links

Trading Reference Links

Thank you very much, perfect example of custom backtester usage. 

--- In amibroker@xxxxxxxxxxxxxxx, Aron <aron.groups@xxx> wrote:
>
> |SetPositionSize(10, *spsPercentOfEquity*);|
> 
> |SetOption( "UseCustomBacktestProc", 1 );
> *if* ( Status( "action" ) == *actionPortfolio* )
> {
> 
>      bo = GetBacktesterObject();
>      bo.preProcess();
> 
> *for* ( bar = 0; bar < *BarCount*; bar ++ )
>      {
> 
> *for* ( sig = bo.GetFirstSignal( bar ); sig && sig.isEntry(); sig = 
> bo.GetNextSignal( bar ) )
>          {
> 
>        _TRACE(""+ sig.posSize);
> *if* ( -sig.posSize/100 * bo.equity > 10000)
>              sig.posSize = -10000/bo.equity * 100;
>          }
> 
>          bo.ProcessTradeSignals( bar );
>      }
> 
>      bo.postProcess();
> 
> }|
> 
> 
> 
> 
> 
> 
> 
> 
> 
> On 1/11/2010 4:11 PM, Roman wrote:
> > spsValue and spsPercentOfEquity are great, however, it is not clear how to limit the size of the position by both money and percent of equity whatever is less.
> >
> > Say, I'd like to trade 10% of equity but no more than $10000 per trade. How to implement it ?
> >
> > Thanks in advance.
> >
> >
> >
> >
> > ------------------------------------
> >
> > **** 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
> >
> >
> >
> >
>




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

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