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

[amibroker] Re: help with trading system



PureBytes Links

Trading Reference Links

thanks Graham,

I'll try it out but it looks good. Stupid I did not find this out 
myself yet .... Problem is that I can't seem to find similar 
examples. Most people write systems (which I find in the AFL library) 
where they define buy and sell signals and then use the ExRem 
function to produce a system (or coupling a buy to a sell signal).

I want to couple the buy to a sell directly.

But I think you helped me on my way.

regards, Ed

--- 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
> http://groups.msn.com/ASXShareTrading
> http://groups.msn.com/FMSAustralia
> 
> 
> -----Original Message-----
> From: ed2000nl [mailto:pablito@x...] 
> 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.
> http://www.c1tracking.com/l.asp?cid=5511
> 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: 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/


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