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

[amibroker] Re: How do two systems with two different positionsizes in one afl?



PureBytes Links

Trading Reference Links

Sounds good, I´m trying this code.

Thanks Mike.
Stefan

--- In amibroker@xxxxxxxxxxxxxxx, "Mike" <sfclimbers@xxx> wrote:
>
> Sounds like a modified version of pairs trading.
> 
> Try changing Tomasz's code a bit from 
> http://finance.groups.yahoo.com/group/amibroker/message/134492 and put 
> all 11 symbols into a single watchlist. Something like the following.
> 
> Mike
> 
> 
> GeneralIndicatorIsLong = ...
> 
> Size = IIF(GeneralIndicatorIsLong, 100, 10);
> SetPositionSize( Size, spsPercentOfEquity );
> 
> if ( Name() == "SymbolA" ) // Single symbol @ 100%
> {
>   Buy = YourSystem1EntrySignal AND GeneraliIndicatorIsLong;
>   Sell = YourSystem1ExitSignal AND GeneraliIndicatorIsLong;
> }
> 
> if ( Name() != "SymbolA" ) // Remaining 10 symbols @ 10%
> {
>   Buy = YourSystem2EntrySignal AND NOT GeneraIndicatorIsLong;
>   Sell = YourSystem2ExitSignal AND NOT GeneralIndicatorIsLong;
> }
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "pointsmax" <pointsmax@> wrote:
> >
> > Hi,
> > 
> > I want code to following system:
> > 
> > 1. if my general indicator tells me to go long, i use system 1 with
> > 100% equity on watchlist 1 in one stock
> > 2. if my general indicator tells me not to go long in system 1, i use
> > system 2 on watchlist 2 with 10 positions (10% of equtiy each.
> > 
> > Please help! Thank you.
> > 
> > Stefan
> >
>




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

**** 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:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto: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/