PureBytes Links
Trading Reference Links
|
If you mean 5 specific stocks, set MaxOpenPositions = 5, PositionSize =
-20 and use a Watchlist of your 5 stocks. (See SetOptions in help.)
--
Terry
-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On
Behalf Of Tony Lei
Sent: Tuesday, July 18, 2006 13:38
To: amibroker@xxxxxxxxxxxxxxx
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 ));
Filter = entries ;
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 ) ;
|