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

RE: [amibroker] Re: help with trading system



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Ed,
<FONT face=Arial color=#0000ff 
size=2>if      <FONT face="Courier New" color=#000000 
size=3>Buy = Cross(RSI(),30);
then 
ref(buy,-1)  would be the previous time that that RSI and 30 crossed. Is 
that what you want? Since you have replaced buy with ref(buy,-1) you are testing 
a buy that you could not have possibly made..... Perhaps you want Buy = 
Cross(RSI(),30); but also want to set trade delay=1 to implement the buy on the 
next day?
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: ed2000nl 
[mailto:pablito@xxxxxxx]Sent: Monday, September 29, 2003 12:31 
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
help with trading systemJayson,yes I 
have.if I run the foolowing code:// overide default 
settingsSetTradeDelays(0,0,0,0);// make a simple trading 
systemBuy = Cross(RSI(),30);// buy the next day at the open// 
use Ref(Buy -1) because the Ref function returns a value// so the "1" 
numbers inside the Buy array are moved forward this way.Buy = Ref(Buy, 
-1);// define the BuyPriceBuyPrice = ValueWhen( Buy, 
Open);SellCond1 = C > BuyPrice * 1.02; SellCond2 = C < 
BuyPrice * 0.96; SellCond3 = Cross( BarsSince(Buy), 5 ); Sell = 
SellCond1 OR SellCond2 OR SellCond3;SellPrice = (SellCond1 * 
C);SellPrice = SellPrice + (SellCond2 * C);SellPrice = SellPrice + 
(SellCond3 * C);Buy = ExRem(Buy,Sell);Sell = 
ExRem(Sell,Buy);for the stock CHKP I get as result in the backtester 
(last 2 trades):CHKP      
Long      7/3/2002      
12.0800      7/5/2002      
14.2600      18.0%      
2029.25      18.0%      
930.847      11244.6      
3273.88      2      
9.02%CHKP      Out      
7/5/2002      14.2600      
10/4/2002      13.4600      
-5.6%      0.00      
0.0%      0      
0      3273.88      
64      0.00%CHKP      
Long      10/4/2002      
13.4600      10/10/2002      
13.9900      3.9%      
522.67      3.9%      
986.172      13273.9      
3796.55      5      
0.79%CHKP      Out      
10/10/2002      13.9900      
9/26/2003      16.6500      
19.0%      0.00      
0.0%      0      
0      3796.55      
242      0.00%the trade started at 7/3/2002 
should be sold the same day at the close. I must have made some error 
somewhere, maybe in the code?thanks,Ed--- In 
amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:> 
Ed,> Do you have "Allow same bar exit" checked?> > 
Regards,> JaysonSend 
BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
suggest@xxxxxxxxxxxxx-----------------------------------------Post 
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
group FAQ at: <A 
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Your use of Yahoo! Groups is subject to the <A 
href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.