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

RE: [amibroker] Re: Variable Position size and Referrencing Tickers



PureBytes Links

Trading Reference Links

I have found this style works better at times

PositionSize= (Name()=="Growth1")*-33 + (Name()=="SectorRotation1")*-33 +
(Name()=="phydx")*-33;


Cheers,
Graham
http://e-wire.net.au/~eb_kavan/

-----Original Message-----
From: ericleake [mailto:eleake@xxxxxxx] 
Sent: Friday, December 31, 2004 4:31 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Variable Position size and Referrencing Tickers



Tomasz or others:

Ok, so what is wrong with this code? I have put the three tickers 
into a watch list, and selected the watch list as the filter, but 
not getting any trades. I do however get trades when selecting 
another watch list.


SetOption("InitialEquity", 100000 );
SetOption("MaxOpenPositions", 3 );
SetTradeDelays(0,0,0,0);


n = Name();
PositionSize= IIf( n == "Growth1", -33,
IIf( n == "SectorRotation1", -33,
IIf( n == "phydx", -33,
-0) ) );

Buy=1;
Sell=0;
Filter = 1;
AddColumn(Close,"Close", 4.2);

I've even tried commenting out the position sizing IIfs and stating 
a straight PositionSize=-33;, but still no trades with this watch 
list. The symbols are accurate.


-Eric.


> Hello,
> 
> You can nest IIFs as infinitely.
> 
> n = Name();
> PostitionSize = IIF( n == "MSFT", 1000,
>                       IIF( n == "INTC", 2000,
>                       IIF( n == "AAPL", 2500,
>                       IIF( n == "GOOG", 1500, 
>                             800 /* otherwise */
>                          ) ) ) );
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "ericleake" <eleake@xxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Thursday, December 30, 2004 6:41 PM
> Subject: [amibroker] Re: Variable Position size and Referrencing 
Tickers
> 
> 
> > 
> > 
> > Graham-
> > Thanks for your response. Are we restricted to an IIf statement 
with 
> > only two alternatives, or can we add additional "if, else"? For 
> > example, four or five different tickers/position sizes?
> > 
> > If I had any clue how to give an attempt at the code, I would. 
But I 
> > simply don't.
> > 
> > -Eric.
> > 
> > \--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> 
wrote:
> >> Don't know if it would actually work, but here is corrected line
> >> 
> >> PositionSize= IIf(name()=="MU", -.25, -50);
> >> 
> >> Cheers,
> >> Graham
> >> http://e-wire.net.au/~eb_kavan/
> >> 
> >> -----Original Message-----
> >> From: ericleake [mailto:eleake@x...] 
> >> Sent: Thursday, December 30, 2004 12:27 PM
> >> To: amibroker@xxxxxxxxxxxxxxx
> >> Subject: [amibroker] Variable Position size and Referrencing 
> > Tickers
> >> 
> >> 
> >> 
> >> A question for the group that I can't find the answer for 
> > elsewhere:
> >> 
> >> Is it possible to select various position sizes per ticker, 
rather 
> >> than equal position sizes? 
> >> 
> >> For example, something like:
> >> 
> >> PositionSize= IIf(Ticker==MU, -.25, -50);, or possibly with 
IIf, 
> >> Else?
> >> 
> >> My objective is to apply various position sizes to several 
> > different 
> >> system equity curves-an asset allocation of strategies, if you 
> > will.
> >> 
> >> Thanks.
> >> -Eric
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> 
> >> Check AmiBroker web page at:
> >> http://www.amibroker.com/
> >> 
> >> Check group FAQ at:
> >> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> >> Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > Check AmiBroker web page at:
> > http://www.amibroker.com/
> > 
> > Check group FAQ at: 
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > Yahoo! Groups Links
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >






Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links



 




------------------------ Yahoo! Groups Sponsor --------------------~--> 
$4.98 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/Q7_YsB/neXJAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> 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/