[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

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@xxxxxxx>
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
> 
> 
> 
> 
> 
> 
> 
>


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