Professional Documents
Culture Documents
T second pass
S act al backtest (sim lation of trading on historical data sing signals collected in &st pass! (exec ted only once per backtest!
%ow to enab e it ?
To enable c stom backtest, yo can se AA-> Settings, Portfolio tab (if yo do so, c stom code will be applied to A'' backtests!
%ow to enab e it ?
...or yo can enable it from the code( *et/ption(01se, stom-acktest%roc0, True !2 or *et, stom-acktest%roc( 0,(334y%ath334y, stom-acktest.afl0 !2 (if yo want to se se external file for it! .n this case c stom backtest will be applied to c rrent form la only.
T what for9
S ser"defined portfolio"level metrics
1edium eve
T *emi"advanced " ses all ob7ect classes T how does it work9
S for each bar(
R we can modify signals, check$modify open positions, retrieve per"trade statistics R then we call defa lt signal processing method
T what for9
S Advanced position sizing S %F"level signal control (c stom rotational trading! S Trade"based metrics
si9; si9 = .o.&et)e:tSi9nal( .ar ) ) ) si9.PosSiEe = 8$5; ) si9.PosSiEe = 8+F; ) si9.PosSiEe = 8+$;
T what for9
S rarely sed, only for very advanced pf systems
1se this(
2iff = ,os=al 8 Borei9n("KTicker<it0<ei90ts"6 "C") 7 Cur!Auit1;
?(
<ow can . access percentage position size to make leverage ad7 stment for expectancy per B&CC invested A( Ao need to store original percent position size from appropriate *ignal ob7ect (if yo are sing reg lar mode!. To do so, yo can se *etDar f nction inside loop sing mid" level
for( sig = bo.GetFirstSignal( bar ); sig; sig = bo.GetNextSignal( bar ) ) VarSet("OrigSize" + sig.Symbol, sig.PosSize ); 'ater on yo wo ld need to read it back when yo iterate thro gh trades. -eca se of complexity . will post code sample a bit later to the E-.
'hank 8ou
"or more information visit: http:66www0amibroker0com