I've coded exactly what I think that you want one week ago or so as a nice 
universal out-of-the-box procedure which is very easy to include into any 
system.
I'll put it into AB's AFL library after I'm done trading today.
One has to use the Custom Backtester (at least that's how I've done it).

--- In amibroker@yahoogroups.com, "pcmoxon" <teklin...@...> wrote:
>
> I am trying to implement a volatility based position size. The system I am 
> working on is based on a 60min timeframe. I read the ATR of the daily 
> timeframe then use that in the calculation to determine the lots size to 
> trade. 'Risk' is a user input variable representing a percentage.
> 
> Pete
> 
> --- In amibroker@yahoogroups.com, "rise_t575" <rise_t@> wrote:
> >
> > 
> > 
> > Just curious,
> > 
> > What are you trying to achieve here? Standard Percent Volatility PS?
> > Why do you multiply risk (how do you define risk) with 1%?
> > 
> > --- In amibroker@yahoogroups.com, "pcmoxon" <teklinkuk@> wrote:
> > >
> > > Hi,
> > > 
> > > I am trying to write some AFL so I can backtest various trading systems 
> > > for forex.
> > > 
> > > One part of the system is to workout how much equity to use for each 
> > > trade.
> > > 
> > > Below is the pseudo logic I want to use but I am not sure how to 
> > > reference the current 'AccountBalance'. I thought of using 'EQUITY(0)' 
> > > but on reading the online help it seems this is for something else.
> > > 
> > >    Lots = Risk * 0.01 * AccountBalance / (ContractSize * ATR)
> > > 
> > > Any help will be appreciated.
> > > 
> > > Regards,
> > > Pete
> > >
> >
>


Reply via email to