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

RE: [amibroker] Long and Inverse Fund



PureBytes Links

Trading Reference Links

Terry, thanks for the detailed instructions.  I tried these but only got
the long fund in the trade list so I am not sure where else I have
something wrong.  I will work on it, clean up the code and publish it
here later as I obviously am doing something wrong.   An Explore with
loads of AddColumns suggest that I have all the variables set up
correctly but still it does not trade as it should.

 

Am I wrong to expect to see the trade list alternate between the long
fund and the inverse fund on every Market Buy signal????

 

BTW, I have a watchlist with only two funds it it, the Long Fund and the
Inverse Fund.

 

I also tried it with Max Open Positions = 1 and forcing PositionScore to
high or low depending on conditions but still got all Long Fund trades.

 

Yikes!!!

 

Ken

 

-----Original Message-----
From: Terry [mailto:MagicTH@xxxxxxxxxxx] 
Sent: Sunday, October 03, 2004 1:51 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Long and Inverse Fund

 

Do this:

BUY = (MarketBuy AND Name() == "RYVYX") or (MarketSell AND Name()  ==
"RYVNX");

Where RYVYX is a Long fund and RYVNX is a Short fund of your choosing.

You will have to either choose All Symbols (slow) or Use Filter and
setup a
filter that contains your funds of interest (a watchlist, group, etc.)

I also keep track of whether I'm on my own buy or sell so I can have a
SELL
signal appropriate to which BUY signal I'm in. Alternatively I'm
thinking
MaxOpenPositions = 1; should also do the trick. Here's my Sell code:

Sell = (MarketSell AND Ref(onBuy,-1) OR (MarketBuy AND Ref(onSell,-1));

Where onBuy and onSell are variables that are TRUE every day that my
MarketBuy and MarketSell signals are in effect.
-- 
Terry

> From: "Ken Close" <closeks@xxxxxxxx>
> Reply-To: amibroker@xxxxxxxxxxxxxxx
> Date: Sun, 3 Oct 2004 12:48:44 -0400
> To: "AmiBroker List" <amibroker@xxxxxxxxxxxxxxx>
> 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 (HYPERLINK
"http://www.grisoft.com)."http://www.grisoft.com).
> Version: 6.0.768 / Virus Database: 515 - Release Date: 9/22/2004
> 
> 
> 
> 
> 
> Check AmiBroker web page at:
> HYPERLINK "http://www.amibroker.com/"http://www.amibroker.com/
> 
> Check group FAQ at:
> HYPERLINK
"http://groups.yahoo.com/group/amibroker/files/groupfaq.html"http://grou
ps.yahoo.com/group/amibroker/files/groupfaq.html
> Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> 



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

Check group FAQ at: HYPERLINK
"http://groups.yahoo.com/group/amibroker/files/groupfaq.html"http://grou
ps.yahoo.com/group/amibroker/files/groupfaq.html 






Yahoo! Groups Sponsor



ADVERTISEMENT
HYPERLINK
"http://us.ard.yahoo.com/SIG=129ao2fjr/M=294150.5475417.6555471.1269404/
D=groups/S=1705632198:HM/EXP=1096912478/A=2380024/R=2/id=noscript/SIG=12
4u69elg/*http:/www.interest.com/includes/server/icom_campaign.asp?id=107
18"

 HYPERLINK
"http://us.a1.yimg.com/us.yimg.com/a/bo/bon_marketing/300x250_yahoo_1001
04.gif"


 HYPERLINK
"http://us.adserver.yahoo.com/l?M=294150.5475417.6555471.1269404/D=group
s/S=:HM/A=2380024/rand=911871583"

 

   _____  

Yahoo! Groups Links

*	To visit your group on the web, go to:
HYPERLINK
"http://groups.yahoo.com/group/amibroker/"http://groups.yahoo.com/group/
amibroker/
  
*	To unsubscribe from this group, send an email to:
HYPERLINK
"mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe"amibro
ker-unsubscribe@xxxxxxxxxxxxxxx
  
*	Your use of Yahoo! Groups is subject to the HYPERLINK
"http://docs.yahoo.com/info/terms/"Yahoo! Terms of Service. 


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


[Non-text portions of this message have been removed]



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/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/