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

RE: [amibroker] Long and Inverse Fund



PureBytes Links

Trading Reference Links

I guess you've tried:

If ( Name() == "InverseFund" ) 
{
    tmp = Buy; // must use temporary variable
    Buy = Sell;
    Sell = tmp;
}

?

d 

> -----Original Message-----
> From: Ken Close [mailto:closeks@xxxxxxxx] 
> Sent: Sunday, October 03, 2004 12:49 PM
> To: AmiBroker List
> Subject: [amibroker] Long and Inverse Fund
> 
> 
> Can someone help with the basic coding to buy a long fund on 
> a market buy signal, and sell it and buy an inverse fund on a 
> market sell signal.
> 
> I put two funds in a watchlist, LongFund and InverseFund.
> 
> I have a Market Timing Signal: either MarketBuy or MarketSell.
> 
> How do I write the Buy and Sell signals and any PositionScore 
> statements (if any) to make the system  BUY the LongFund and 
> SELL the InverseFund on MarketBuy signal, and the reverse, 
> SELL the LongFund and BUY the InverseFund on MarketSell signal?
> 
> I have tried various combinations of PositionScore and IIf 
> statements to no avail.  The trade report buys the LongFund 
> on every MarketBuy signal and sells it on every MarketSell 
> signal but never "buys" the InverseFund.
> 
> Totally frustrated.
> 
> Any help?
> 
> Thanks,
> 
> Ken
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.768 / Virus Database: 515 - Release Date: 9/22/2004
>  
> 
> 
> 
> ------------------------ Yahoo! Groups Sponsor 
> --------------------~--> Make a clean sweep of pop-up ads. 
> Yahoo! Companion Toolbar.
> Now with Pop-Up Blocker. Get it for free!
> http://us.click.yahoo.com/L5YrjA/eSIIAA/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
> 
> 
> 
>  
> 
> 
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/