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

Re: [amibroker] Re: Different exits for different entries + equity management



PureBytes Links

Trading Reference Links

Hi there,

Here is what I managed to achieve:

SetPositionSize( 50, spsPercentOfEquity );
SetOption("MaxOpenPositions", 2 );

Buy1 = rule1;
Sell1 = BarsSince(Buy1) == 3;


Buy2 = rule2 ;
Sell2 = BarsSince(Buy2) == 5;

Buy3 =  rule3 ;
Sell3 = BarsSince(Buy3) == 2;

Buy4 =  rule4;
Sell4 = BarsSince(Buy4) == 1;

Buy = Buy1 OR Buy2 OR Buy3 OR Buy4 ;
Sell = Sell1 OR Sell2 OR Sell3 OR Sell4;


Two problems remain:

1) I'd like to establish a margin of 100 for rule 1 and 2, a margin of 50 for rule 3 and a margin of 33 for rule 4.  Don't know how to do it;
2) Some of my signals cross each other; I want each signal to buy 50% of the equity leaving the other 50% "ready" for another signal while the first signal is still open...  Right now with that code I only get the first signal and the second one is ignored.  E.g.  If Buy2 enters a position on May 5 and there is a signal on May 6, May 6 signal will get ignored.  What I want is 50% on May 5 and if a signal comes on May 6 I want another 50%.  Is this possible?

Thanks again,

Louis






2008/5/13 Louis Préfontaine <rockprog80@xxxxxxxxx>:
Hi again,

Ok here is what I am trying to do.  I'll try to add as much details as I can.

There is three different conditions on which I want to react differently.

Condition 1) I buy the stock with full margin and full power and exits after 10 days;
Condition 2) I buy the stock with no margin and exits after 10 days;
Condition 3) I buy the stock with no margin and with less than 50% of my equity and exits after 5 days.

I am looking for a code to do this.  It does not look that complicated, but I don't know how to do it.

If someone has any idea...

Thanks,

Louis



2008/5/13 louisprefontaine <rockprog80@xxxxxxxxx>:

Anyone?

Thanks,

Louis

--- In amibroker@xxxxxxxxxxxxxxx, "Louis Préfontaine" <rockprog80@xxx>
wrote:


>
> Hi,
>
> I am looking for a way to set different sell signals depending on
particular
> buy signals. E.G. For cond1 I want a particular sell, and for cond2
> another particular sell.
>
> Also, I'd like to set a different equity management for each condition.
> E.g. For cond1 I want to use 50 margin, for cond2 33 margin and for
cond 3
> 100 margin, etc.
>
> Anyone can help me with that?
>
> Thanks,
>
> Louis
>



__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___