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

[amibroker] Re: Problem with AddToComposite



PureBytes Links

Trading Reference Links










You are encountering the problems associated with trading in
general. Ho do you know if you should have sold, when you know that you will
have a better buy signal in the next couple of days. You cannot foretell the
future, so you are stuck with an earlier buy signal than you would otherwise
have wanted “in hindsight”. You have made a sell signal reliant on
certain conditions, but if you are not happy with the fact that you are not
getting sell signals when you wanted them you will need to change the sell
conditions. But, then you will find another situation when you get a sell
signal that you don’t want, so do you change the conditions for that
situation, and forego the earlier conditions that you changed before???

 

Basically, to me, mechanical trading like any form of
trading, is a balance of getting enough profits to overcome losses. You will
never be able to get 100% profitable trades, so you try to reduce the losses
incurred.

 

If you only ever want profitable trades, just have sell
signal that is the buyprice + a percent. If you are lucky enough stocks will go
up to reach the sell price signal, but this is not guaranteed.

 



Cheers,
Graham
http://e-wire.net.au/~eb_kavan/ 



<span
>-----Original Message-----
From: Linda Wilmarth
[mailto:smart@xxxxxxxxxx] 
Sent: Wednesday, June 23, 2004
9:54 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Problem
with Extraneous Buy Signals

<font size=2
face="Times New Roman"> 



<font size=2
face="Times New Roman">Gary,





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">This changes the results,
but doesn't solve the problem completely.





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">On 2/27/02, the RSI
crosses below 30 and so the system buys on 2/28/02 like it should.  The
RSI then rises above 30, but the Close is not high enough over the next couple days
to make the Sell condition be True.  Then on 3/2/01, the RSI falls below
30 again.  Since the system is already in the middle of a trade, there is
not another buy signal, which is what I want.  





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">But the code now exits
when the close is higher than what the entry would have been on the 2nd
(potential) signal instead of what the entry really was on the first (real)
signal.  The system exits at a loss, when I want to always wait until
there is a profit before exiting.





<font size=2
face="Times New Roman"> 





<font size=2
face="Times New Roman">Linda  







<span
>----- Original Message ----- 





<font
size=2 face=Arial>From: <a
href="" title="serkhoshian777@xxxxxxxxx">Gary A.
Serkhoshian 





<span
>To:<font
face=Arial> <a
href="" title="amibroker@xxxxxxxxxxxxxxx">amibroker@xxxxxxxxxxxxxxx






<span
>Sent:<font
face=Arial> June 22, 2004 8:37 PM





<span
>Subject:<font
face=Arial> Re: [amibroker] Problem with
Extraneous Buy Signals





<font size=2
face="Times New Roman"> 



<font size=2
face="Courier New">Linda,<font
face="Courier New">

The problem is that 

Cond1 = RSI(14)<30

is always true when RSI is below 30.  All you
want is
the cross.  So, use Cross(30, RSI(14))
instead.

Regards,
Gary

--- Linda Wilmarth <<a
href="">smart@xxxxxxxxxx> wrote:
> I am having problems with a system that I am
> writing.  
> 
> I have simplified it to the basics for
testing
> purposes.  At this point, I am testing
the system
> using EOD data for QQQ only.  
> 
> The system will buy at the next Open if the
14-day
> RSI is less than 30.  Then I want to
sell at the
> first close where I have made a profit, which
may
> even be the same day that I buy.
> 
> The code works fine if the RSI drops below 30
for 1
> day only, e.g. it buys and sells on 4/17/00,
and it
> buys on 4/29/02 and sells on 4/30/02.  
> 
> But if the RSI stays below 30 for more than 1
day,
> the code does not work.  For example,
the RSI drops
> below 30 on 10/10/00 and the system correctly
buys
> on 10/11/00.  It should sell on the same
day
> (10/11/00) because there would have been a
small
> profit that day.  But it does not - the
RSI is also
> less than 30 on 10/11/00 and the code does
not
> produce the desired results.  It waits
until
> 10/12/00 to sell.  Then it buys again on
10/12/00,
> which it should since the RSI on 10/11 was
less than
> 30, but does not sell until 2/28/01, when it
should
> have sold the next day on 10/13/00.
> 
> I've included the code below.  Anyone
have an idea
> what I am doing wrong?
> 
> Thanks
> 
> Linda
> 
> Var0 = 1;
> 
> SetOption ("InitialEquity",
100000); 
> 
> SetOption ("MaxOpenPositions",
Var0);
> 
> PositionSize = -100/Var0; // to compound
results
> 
> BuyPrice = Open;
> 
> SellPrice = Close;
> 
> SetTradeDelays ( 1, 0, 1, 1); // buy, sell,
short,
> cover
> 
> // BUY
>
--------------------------------------------------------------
> 
> 
> Cond1 = RSI(14)<30;
> 
> Buy = Cond1 ;
> 
> // SELL
>
--------------------------------------------------------------
> 
> 
> Cond102 = Close >
Ref(BuyPrice,-BarsSince(Buy)+1);
> 
> Sell = Cond102 ; 
> 
> Buy = ExRem (Buy, Sell);
> 
> Sell = ExRem (Sell, Buy);
> 
> 



     
      
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail



Check AmiBroker web page at:<font
face="Courier New">
http://www.amibroker.com/

Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html





Check AmiBroker web page at:<font
face="Courier New">
http://www.amibroker.com/

Check group FAQ at: <a
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html










Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html








Yahoo! Groups Sponsor


  ADVERTISEMENT 












Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/ 
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx 
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.