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

[amibroker] Re: help with trading system



PureBytes Links

Trading Reference Links

hi Jayson,

I started with such a simple system in order to be able to track what 
is going on.

1) I start with   

SetTradeDelays(0,0,0,0);
Buy = Cross(RSI(),30);  

then I look in the chart (standard Price chart) where the buy signals 
are.

2) now I make a change: 

SetTradeDelays(1,0,0,0);
Buy = Cross(RSI(),30);

and again I look where the buy signals are: nothing changed?

I think I am missing something ...


Indeed "Buy = Ref(Buy, -1);" is not the proper thing to use for my 
purposes although it seems to move the moment of purchase 1 day 
forward.

Seems I am lost here. If I make a change from SetTradeDelays
(0,0,0,0); to SetTradeDelays(1,0,0,0); and no difference can be seen 
things get complicated.

Maybe you can point me to a similar example somewhere in the archive 
which does similar things as my example. I am not really interested 
in systems like: 
Buy = Cross(RSI(),30);
Sell = Cross(70,RSI());
I want to closely monitor a buy signal and then find an exit point 
like in my example.

thanks,

rgds, Ed 
  



--- In amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:
> Ed,
> if      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
> -----Original Message-----
> From: ed2000nl [mailto:pablito@x...]
> Sent: Monday, September 29, 2003 12:31 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: help with trading system
> 
> 
> Jayson,
> 
> yes I have.
> 
> if I run the foolowing code:
> 
> // overide default settings
> SetTradeDelays(0,0,0,0);
> 
> // make a simple trading system
> Buy = 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 BuyPrice
> BuyPrice = 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,
> > Jayson
> 
> 
> 
>       Yahoo! Groups Sponsor
>             ADVERTISEMENT
> 
> 
> 
> 
> Send BUG REPORTS to bugs@xxxx
> Send SUGGESTIONS to suggest@xxxx
> -----------------------------------------
> 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.


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