PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Ed,
Do you
have "Allow same bar exit" checked?
Regards,
Jayson
<FONT face=Tahoma
size=2>-----Original Message-----From: ed2000nl
[mailto:pablito@xxxxxxx]Sent: Monday, September 29, 2003 11:32
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re:
help with trading systemhi,thanks for your
reply.I tried with settradedelays(0,0,0,0) which is the default. Doesn't
this mean that the buydelay and the selldelay are 0, or 0
days/bars?So, that would mean that it would look for a sell at the same
day of purchase?From the help and the manual I can't figure out
wether the buydelay, selldelay etc inside settradedelays are flags or actual
days (bars). However in my little program below setting
settradedelays(0,0,0,0) does not sell at the same day of purchase when it
should.thanks and regards, Ed--- In
amibroker@xxxxxxxxxxxxxxx, "Jayson" <jcasavant@xxxx> wrote:>
Ed> check settings/trade delay it sounds like you have it set to 1
which means> "Next bar"> > Regards,>
Jayson> -----Original Message-----> From: ed2000nl
[mailto:pablito@xxxx]> Sent: Monday, September 29, 2003 10:23 AM>
To: amibroker@xxxxxxxxxxxxxxx> Subject: [amibroker] Re: help with trading
system> > > hi,> > I have one additional
question (for now ...). I have this simple> trading system (see below). I
buy at the open. If I would like to> sell the same day at the close if it
exceeds the threshold of in this> case 4% how do I program that. Now
it only starts finding sell> signals the day after the purchase.>
> thanks, Ed> > > > //
------------------------------------------------------------------>
// 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.04;> 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);> //
------------------------------------------------------------------>
> > > > > --- In amibroker@xxxxxxxxxxxxxxx,
"Graham" <gkavanagh@xxxx> wrote:> > Ed, you should not need to
do loops for this, just set the> conditions you> >
want.> > Is this close to what you were wanting?> >>
> SetTradeDelays( 0, 0, 0, 0 );> > Buy = YourBuyCondition;>
> Buy = Exrem( Buy, Sell );> > SellCond1 = Cross( C, Valuewhen(
Buy, C) * 1.02 );> > SellCond2 = Cross( Valuewhen( Buy, C) * 0.96, C
);> > SellCond3 = Cross( Barssince(buy), 5 );> > Sell =
SellCond1 OR SellCond2 OR SellCond3 ;> > SellPrice = C;>
>> >> > Cheers,> > Graham> > <A
href="">http://groups.msn.com/ASXShareTrading>
> <A
href="">http://groups.msn.com/FMSAustralia>
>> >> > -----Original Message-----> > From:
ed2000nl [mailto:pablito@xxxx]> > Sent: Monday, 29 September 2003 4:45
PM> > To: amibroker@xxxxxxxxxxxxxxx> > Subject: [amibroker]
help with trading system> >> >> > hi,>
>> > I need some basic help with trading systems. I am so used to
an> other> > programming language and can't seem to find out
how to fully> utilise> > AB in similar ways.>
>> > as an example I want to find out how to program a simple
system> >> > 1) say I got my "buy" array defined.>
>> > 2) now I want to sell in the following days at the close
whenever> the> > price has increased by 2% or more.>
>> > 3) I sell with a loss at the close whenever the price
decreases by> 4%> > or more.> >> > 4) and I
sell at the close price when the number of trading days> > exceeds 5
and the stock is still in possesion.> >> > How could I use
AFL in the best way. Do I need to use loopings?> >> > thanks
in advance,> >> > Ed> >> >> >
------------------------ 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.> > <A
href="">http://www.c1tracking.com/l.asp?cid=5511>
> <A
href="">http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM>
>
-------------------------------------------------------------------->
-~->> >> > Send BUG REPORTS to bugs@xxxx> >
Send SUGGESTIONS to suggest@xxxx> >
-----------------------------------------> > 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> <A
href="">http://docs.yahoo.com/info/terms/>
> > 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: <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 Yahoo! Terms of
Service.Send
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.
|