Set the option in the Analysis settings window, else add directly to
code:
SetOption("MaxOpenPositions", 1 );
More details in the user guide:
http://www.amibroker.com/guide/h_portfolio.html
Mike
--- In [email protected], Noah Bender <knowaben...@...> wrote:
>
> Hello all,
>
>
> I am new to amibroker and am tryng to set up a strategy. i would
like to
> only execute trades when I have no open position.
>
> Does anyone know how I can write that in AFL??? I only only buy and
go short
> when current position is zero.
>
> thanks
>