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

RE: [amibroker] Re: help with trading system



PureBytes Links

Trading Reference Links




Ed 

check 
settings/trade delay  it sounds like you have it set to 1 which means "Next 
bar"
 
Regards, 
Jayson 
<FONT face=Tahoma 
size=2>-----Original Message-----From: ed2000nl 
[mailto:pablito@xxxxxxx]Sent: Monday, September 29, 2003 10:23 
AMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
help with trading systemhi,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 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.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/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












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.