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

Re: [amibroker] Force Buy of Particular Fund



PureBytes Links

Trading Reference Links

Ken,

No I don't think I missed anything.
I don't see any problem with purchasing money market fund when
all other securities are exited. This is so simple that I though you can add it 
by yourself:

fc = Foreign("INDEX", "C")

Buy = Cross( fc, MA( fc, 50 );
Sell = Cross( MA( fc, 50 ), fc );

PositionScore = 100 - RSI();

// buy the fund when selling stocks and sell fund when buying stocks
if( Name() == "MMFUND" )
{
   Buy = Sell;
   Sell = Buy;
   PositionScore = 100;
}



Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "Ken Close" <closeks@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Sunday, October 05, 2003 6:13 PM
Subject: RE: [amibroker] Force Buy of Particular Fund


> Tomasz:
> 
> Thanks for the reply and I am hoping someone else can help to relieve
> your email reply burden....
> 
> ...however, you have missed my question entirely.
> 
> I understand your example below.  I want to BUY a money market fund or
> another fund, when the market signal says to sell all positions in funds
> that have been bought with the ranking AND the MarketBuy signal.
> 
> The answer may be in your reply but I do not think so.
> 
> Buy = OnMarketBuy (you get the top 4 [say] ranked funds.)
> Sell = OnMarketSell (you sell all holdings)  (and at the same time BUY a
> mm fund)
> 
> How do you then BUY another fund (money market or government bonds or
> whatever), when you get OnMarketSell signal.
> 
> In the ranking, it is possible but not likely that the moneymarket fund
> would be the highest ranked when the MarketSignal goes on a sell.  
> 
> So sorry if I just can not see the answer to this question in your reply
> below.  Can anyone else help me?
> 
> Ken
> 
> -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@xxxxxx] 
> Sent: Sunday, October 05, 2003 11:46 AM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Force Buy of Particular Fund
> 
> Ken,
> 
> There is no NEED to use rotational mode at all. It is provided as a
> faster replacement
> for already existing PT formulas. But for nothing more.
> 
> 99% of cases are solved by regular mode.
> 
> You just need REGULAR mode all the time if you have buy/sell signals.
> Regular mode ALLOWS RANKING TOO and allows buy/sell signals to be
> evaluated.
> 
> So use REGULAR mode.
> 
> fc = Foreign("INDEX", "C")
> 
> Buy = Cross( fc, MA( fc, 50 );
> Sell = Cross( MA( fc, 50 ), fc );
> 
> PositionScore = 100 - RSI();
> 
> 
> This code would attempt to enter long on *all securities* at the same
> time
>  when INDEX close rises above its MA
> and will exit long on INDEX close falling above MA.
> 
> Among all securities under test ONLY THOSE scored HIGHEST will be
> entered.
> (in the example formula securities with LOW RSI are preferred)
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "Ken Close" <closeks@xxxxxxxx>
> To: "AmiBroker List" <amibroker@xxxxxxxxxxxxxxx>
> Sent: Sunday, October 05, 2003 5:37 PM
> Subject: [amibroker] Force Buy of Particular Fund
> 
> 
> > First question on coding I can not figure out...
> > 
> > I want to buy ranked and scored funds on the Buy of a general market
> > signal, and then Sell all of them on the Sell of the general Market
> > Signal.
> > 
> > When the general market signal is on a Sell I would like the
> Backtester
> > to be holding (ie, having Bought) a money market mutual fund or some
> > other "safe" fund acting as a substitute for the mm fund.
> > 
> > I do not know how to even start (and perhaps I should wait until
> > Interest is included) but if it is possible to code this situation,
> then
> > how to do it?
> > 
> > Other code.....
> > 
> > Buy = IIf( MarketBuyOn, 1, ???????);
> > 
> > I have no idea how to do this.  Anyone?
> > 
> > Perhaps there is a way to use Rotational Trading Mode....
> > 
> > With MarketBuyOn, then rank all funds and select, and when MarketBuyOn
> > is "0" (off), then force the rank score of the mm fund high and others
> > to low value (artificially).  If Positions = 4, will it buy four
> > positions in the MM fund (essentially putting all equity into the MM
> > fund) or will it only buy 1 position (25% in the mm fund)?
> > 
> > My experience level with portfolio trading is low enough that I may
> not
> > have the right to ask these questions, but what better way to learn --
> > Again, any comments?
> > 
> > Ken
> > 
> > 
> > 
> > Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> > Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > 
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> > 
> > 
> > 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/ 
> 
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/