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

[amibroker] AmiBroker 4.54.0 BETA released



PureBytes Links

Trading Reference Links

Hi Graham!  Here's my code for the simple buy/sell system I use:


PositionSize = -25; // invest 25% of portfolio equity in single trade


Buy = BarsSince( Cross( PDI( 3 ), MDI( 3 ) ) ) <= 1 AND ADX( 3 ) > 33 
AND Ref( HHV( ADX( 3 ), 5 ), -1 ) < ADX( 3 );
Sell = BarsSince( Cross( MDI( 3 ), PDI( 3 ) ) ) <= 1;

AlertIf( Sell, "", "Sell DMI", -1);
AlertIf( Buy, "", "Buy DMI", -1);

PositionScore =RSI(3); // prefer stocks that have high RSI


My two issues are one the position size function not taken into 
account margin.  And two, sometimes I received buy/sell indicators on 
the next day for the previous day.  Ideally I want a system which 
allows trades to be entered at the end of day or before the market 
opens.  For example the above code generated a sell signal on GNSS 
for 4/27, but did not give me this data until this morning 4/28.  I 
update each morning using Yahoo historical quotes.

Thanks in advance for your help!

John




--- In amibroker@xxxxxxxxxxxxxxx, "Graham" <gkavanagh@xxxx> wrote:
> It is a bit hard to comment without the formula you are using.
> But one suggestion is that you may be looking into the future (eg 
ref(c,1))
> in which case the signals can become erratic as new bars are added.
> 
> Cheers,
> Graham
> http://e-wire.net.au/~eb_kavan/
> 
> -----Original Message-----
> From: fsmart21 [mailto:jdgeddie@x...] 
> Sent: Saturday, April 24, 2004 9:50 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Beginner Questions
> 
> Hello All!  I've now been using AmiBroker for about 3 weeks.  
> 
> I've noticed a few quirks which I cannot quite get to the bottom 
of.  
> I have my indicator built and this works fine.  I do not trade 
> intraday, and download data each morning using Yahoo historical 
> quotes.  I then run backtester to figure out which trades to make. 
> 
> Sometimes after I run backtester I see new trades for the same day 
> which were not previously present.  I've noticed that most of these 
> trades (but not all) are the result of a gap up in price on the day 
> in question.  For example, yesterday morning my indicator generated 
a 
> buy signal on VCLK as well as some others based on 4/22 EOD data.  
> This morning I downloaded EOD data for 4/23 and noticed a new trade 
> for MCRL which was not present yesterday morning.  How would I 
> eliminate this trade from my backtest results?
> 
> My second question is that my formula determines the # of shares to 
> buy based on 25% split of my portfolio.  Since I included this in 
the 
> formula, it no longer will account for margin when determining the 
# 
> of shares to buy.
> 
> Can anyone help? 
> 
> Thanks for your time!
> 
> 
> 
> 
> 
> 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 
> Yahoo! Groups Links



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 
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:
     http://docs.yahoo.com/info/terms/