For five stocks you can still do it.
Make the Watchlist, use the settings I
suggested.
Make conditions for each stock as
follows:
Stock1Buy = yourConditions AND Name() =
"MSFT"; //insert the stock you want to trade
Stock2Buy = yourConditions AND Name() =
"AAPL"; //insert the stock you want to trade
Stock2Buy, etc.
Buy = Stock1Buy OR Stock2Buy OR
Stock2Buy OR Stock4Buy OR Stock5Buy;
Same concept for Sells, Shorts and
Covers if they are also different.
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Tony Lei
Sent: Tuesday, July 18, 2006 16:54
To: [email protected]
Subject: Re: [amibroker] Re: Need
some assistance with this system
Terry,
The only problem is that my 3 parameters are different for each stock.
thanks
tony
On 7/18/06, Terry <[EMAIL PROTECTED]> wrote:
If
you mean 5 specific stocks, set MaxOpenPositions = 5, PositionSize = -20 and
use a Watchlist of your 5 stocks. (See SetOptions in help.)
-----Original Message-----
From: [email protected]
[mailto: [email protected]
] On Behalf Of Tony Lei
Sent: Tuesday, July 18, 2006 13:38
To: [email protected]
Subject: Re: [amibroker] Re: Need
some assistance with this system
Hi all,
I came up with the following but I have a problem duplicating this in an
exploration for 5 different stocks. What is the best way to implement
this to 5 different stocks?
thanks
tony
TradeOpenNumber = Param("1st Trade Open Number",0.83,0,1,.01);
ProfitTargetNumber = Param("Profit Target
Number",1.39,0,2,.01);
RiskNumber = Param("Risk Number",1.67,0,2,.01);
MarketHours = TimeNum()>=92900 AND TimeNum()<=160000;
TodayOpen = TimeFrameGetPrice( "O", inDaily, 0 );
TodayHigh = TimeFrameGetPrice( "H", inDaily, 0 );
TodayLow = TimeFrameGetPrice( "L", inDaily, 0 );
entry1 = todayOpen + TradeOpenNumber ;
Long = Cross ( C, entry1) ;
entry2 = todayOpen - TradeOpenNumber ;
Short = Cross ( entry2, C ) ;
Sell1 = entry1 + ProfitTargetNumber;
Cover1 = entry2 - ProfitTargetNumber;
reverse_short = TodayHigh - RiskNumber ; //round to
lower 1/8
reverse_long = TodayLow + RiskNumber ; //round to higher 1/8
entries = Long OR Short ;
exit = IIf( Long , Sell1, IIf( Short, Cover1, 0 ));
AddColumn (TodayOpen, "Open", 1.2) ;
AddColumn (TodayLow, "Low", 1.2) ;
AddColumn (entry1, "Long", 1.2, IIf ( long, colorBlue, 0) ) ;
AddColumn (entry2, "Short", 1.2, IIf ( Short, colorRed, 0 ) ) ;
AddColumn (IIf (Long, Sell1, IIf (Short, Cover1, 0)), "Profit Target"
, 1.2) ;
AddColumn (IIf (C>entry1, reverse_short, IIf (Short, reverse_long, 0)),
"Reversal", 1.2 ) ;
__._,_.___
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.html
SPONSORED LINKS
YAHOO! GROUPS LINKS
__,_._,___
|