PureBytes Links
Trading Reference Links
|
Ken,
I ended up with the following. This moves me from Long to a Hedged fnu. That is, Long_Pos is my Portfolio fnu, Hedge_Pos is my 60/40 hedge or whatever hedge level. MH_Buy and MH_Sell are whatever buy and sell signal that one wants. This is a backtest and not rotational trading. The long and hedge fund must be in a watchlist.
This is similar, I think, to what you are doing.
// Final Buy and Sell Logic
// -----------------------------------------
Buy = Sell = Short = Cover = 0;
if (Name() == Long_Pos)
{
Buy = MH_Buy;
Sell = MH_Sell;
}
if (Name() == Hedge_Pos)
{
Buy = MH_Sell;
Sell = MH_Buy;
}
Ken Close <closeks@xxxxxxxx> wrote:
Reply to my own request----in searching the archives, I find that I
advised Bert Steele on this same problem and told him how to accomplish
it. Now, I am actually trying my own advice and can not make it work.
:-((((( It sounded good when I wrote the "answer" but it won't work for
me in the actual AA window. Bummer.
Bert, did you ever get it to work---tell me how if yes?
Anyone else with a solution?
Ken
-----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
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
---
Incoming 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
---
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
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
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
[Non-text portions of this message have been removed]
------------------------ 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/
|