[amibroker] Looking for updates AFL files

2007-01-10 Thread Bill Halliday
Hi, I'm just learning AFL and copied several of your contributions to the AFL Library put there by Steve Wiser. The email address listed in the AFL files isn't current! Has anyone revised these programs to run in the current version of AmiBroker? The programs I copied are:

Re: [amibroker] Re: Not Compounding profits in backtester

2007-01-10 Thread Jerry Laster
Have you tried, SetOption( InitialEquity, 10 ) at the begining of the code? That will not take into account any loses, but will always trade with that fixed amount. Jerry On Mon, 08 Jan 2007 23:09:39 -0500, brentonfx [EMAIL PROTECTED] wrote: Graham I don't actually want to size

[amibroker] Backtester question

2007-01-10 Thread Andrew Z
G'day all, I'm trying to get my head around how the backtester uses the available price data to test a system. As an example, say I have an hourly system. In AA - Settings I set the Periodicity to Hourly. However, in my price data, that hour is made up of 12 x 5min bars. Does the backtester use

RE: [amibroker] Very profitable DOW system

2007-01-10 Thread Nick Busigin
Hi Terry, Thanks very much for taking the time to check my code analysis and also for your comments that cleared up the points that I was unsure of. Nick On Tue, 9 Jan 2007, Terry wrote: Almost 100% right. See below for my comments and answers. -- Terry

Re: [amibroker] Very profitable DOW system

2007-01-10 Thread Nick Busigin
Hi Ed, Thanks for posting the original code and also for providing a link to Dimitris' original message. Working through the code, along with Terry's help has solidified my understanding of aspects of the AFL language that I was not sure of. Nick On Wed, 10

[amibroker] Re: How to switch the realtime datafeed account ?

2007-01-10 Thread itmwh
I checked port of the TWS of account 2, it is 7496. But still it can not switch in to feed the data when TWS of account 2 has been closed. I also noticed there is a dialogue of client ID in the IB plugin setup of the database setting, but that dialogue seems unable to designate the

[amibroker] loop counter

2007-01-10 Thread klaus_korneker
Hello, i am trying to build a counter with a loop. i have already tried the following, but it seems that anything is wrong. The chart shows the bar number, but when i click inside the chart, the number changes. Cnt[0] = 0; for( i = 0; i BarCount; i++ ) { Cnt[ i ] = i ; } Graph0 = Cnt;

RE: [amibroker] Backtester question

2007-01-10 Thread Terry
It composites the lower time frame values automatically into the hourly time frame. -- Terry -Original Message- From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andrew Z Sent: Wednesday, January 10, 2007 05:04 To: amibroker@yahoogroups.com Subject: [amibroker]

RE: [amibroker] Re: How to switch the realtime datafeed account ?

2007-01-10 Thread Terry
Instructions about halfway down after the release notes: http://www.amibroker.com/ib.html -- Terry -Original Message- From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of itmwh Sent: Wednesday, January 10, 2007 07:24 To: amibroker@yahoogroups.com Subject: [amibroker]

[amibroker] Re: Help Request: matching Industry ID's across watchlists

2007-01-10 Thread brpnw1
Hi Terry, Sorry, the attachments never made it to my email inbox for some reason. If you could send to siddha [at] gmail [dot] com that would be great! Really all I need is an example of how to match the IndustryID's of ticker symbols in one watchlist with those of another watchlist. Any

Re: [amibroker] Re: How to switch the realtime datafeed account ?

2007-01-10 Thread toxutao
Hi, I checked the page but can not find the relevant material - Original Message - From: Terry To: amibroker@yahoogroups.com Sent: Wednesday, January 10, 2007 11:11 PM Subject: RE: [amibroker] Re: How to switch the realtime datafeed account ? Instructions about halfway

[amibroker] Re: loop counter

2007-01-10 Thread klaus_korneker
Hi Terry, thank you very much for your explanation ! However it looks a little bit strange. It works still the same. When set the entire array to 0 with Cnt = 0; and click Apply, it shows the same value as with the confirmation code in the graph. However automatically after about 1 second it

[amibroker] Plotting Horizontal Lines

2007-01-10 Thread Bill Halliday
I'm trying to plot a horizontal line on an Intraday Price Chart. Here is the formula I'm using: TodaysMidPoint = ( YesterdaysHigh + YesterdaysLow + YesterdaysClose) / 3 ; // Don't worry Yesterdays Values are being calculated! Here is how I'm plotting it: PlotGrid( LastValue(

RE: [amibroker] Re: Help Request: matching Industry ID's across watchlists

2007-01-10 Thread Terry
You must receive emails to get attachments. They are not saved in the web version. I will email you direct this time only. -- Terry -Original Message- From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of brpnw1 Sent: Wednesday, January 10, 2007 08:41 To:

[amibroker] Help for a simple formula

2007-01-10 Thread mravie7
Hi, Can anyone help me with a simple formula (i am new to this system) for 20 and 50 period MA Buy when PRICE moves OVER 20 MA and 20 MA is OVER 50 MA Sell when PRICE moves UNDER 20 MA but 20 MA is OVER 50 MA Short when 20 MA is UNDER 50 MA and PRICE crosses under 50 MA COVER SHORT when

Re: [amibroker] Help for a simple formula

2007-01-10 Thread Prashanth
Hello, Buy = Cross(C,MA(C,20)) AND MA(C,20) MA(C,50); Sell = Cross(MA(C,20),C) AND MA(C,20) MA(C,50); Short = Cross(MA(C,50),C) AND MA(C,20) MA(C,50); Cover = Cross(C,MA(C,20)) AND MA(C,20) MA(C,50); Cheers Prashanth - Original Message - From: mravie7 To:

[amibroker] Re: Trade.DateTime to DateNum

2007-01-10 Thread whitneybroach
Are you referring to trade.EntryDateTime as from the custom backtester object? More generally, how does one extract the date from DateTime() so as to compare with DateNum() ?

[amibroker] Re: loop counter

2007-01-10 Thread klaus_korneker
Thanks for the explanation. But how can i now create a barindex(counter) through a loop. Graph1 plots the barindex. I have tried to use (i = 0; i LastValue(BarIndex()); i++ ) but this generates an error. Can you help ? Cnt = 0; for( i = 0; i LastValue(BarIndex()); i++ ) { Cnt[ i ] = i ; }

[amibroker] TWS API Req Mkt Data - Any Limitation?

2007-01-10 Thread ShortFox
Hello, Does anybody know what is the limitation on calling TWS's API function Req Mkt Data? I don't need historical data, only real-time (or roughly real-time) data for as much symbols as possible, retrieved once in five minute or so. Is there any limitation? Thanks, Short.

[amibroker] Backtest Results

2007-01-10 Thread troll
Minor question but unable to find anything in the reference material, settings or help files. Now getting Short(21), Long(15) (or some number) in AA Backtest screen and curious where/why bracketed numbers came from. Best Regards, Dean H.

Re: [amibroker] Re: loop counter

2007-01-10 Thread Tomasz Janeczko
Hello, See Comments section in BarIndex() reference: http://www.amibroker.com/guide/afl/afl_view.php?barindex When running a loop over array you must NOT access elements outside 0..BarCount-1 range. The code that you want to write should look as follows: bi = BarIndex(); for( i = 0; i

Re: [amibroker] loop

2007-01-10 Thread Graham
You can do this in normal functions condition = sum(Lref(C,-1),20)=5; -- Cheers Graham AB-Write Professional AFL Writing Service Yes, I write AFL code to your requirements http://www.aflwriting.com On 11/01/07, thecoolestdude1369 [EMAIL PROTECTED] wrote: i've got the loop part to have ab

[amibroker] Re: DDE Excel

2007-01-10 Thread treliff
--- In amibroker@yahoogroups.com, Tomasz Janeczko [EMAIL PROTECTED] wrote: Frankly I see NO reason connecting via excel. TJ, a very bold statement indeed! Can you back that up and explain how to store bid/ask data in AB without using Excel? The way I've been doing this for years is to

Re: [amibroker] Re: loop counter

2007-01-10 Thread Graham
add setbarsrequired(1,1); to the top of your code you need this when you use loops, and especially when using Barcount -- Cheers Graham AB-Write Professional AFL Writing Service Yes, I write AFL code to your requirements http://www.aflwriting.com On 11/01/07, klaus_korneker [EMAIL

[amibroker] Re: loop

2007-01-10 Thread thecoolestdude1369
awesome you guys are the best. i think there's steam coming out of my ears trying to figure this out and soo simple thx again joe --- In amibroker@yahoogroups.com, Graham [EMAIL PROTECTED] wrote: You can do this in normal functions condition = sum(Lref(C,-1),20)=5; -- Cheers

Re: [amibroker] Re: DDE Excel

2007-01-10 Thread Tomasz Janeczko
Hello, For your specific case. Use IB plugin http://www.amibroker.com/ib.html and GetRTData http://www.amibroker.com/f?getrtdata GetRTData(Bid) GetRTData(Ask) Also orignal enquiry was not about storing data but about communication. If you want to store any extra data it is much better

[amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread trb0428
Ara, My goal is to plot the data. I do not see how I can use this structure to plot? Is there a way to store this element by element data into an artificial ticker symbol. I have thought of impplementations using ATC but cannot arrive at a solution this way??? Is there any other way to store

Re: [amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread Graham
Tom Exactly what are you trying to achieve? What are the arrays ? btw Varset is an array, staticvarset is a single value VarSet(Close,C); Plot(VarGet(Close),Close,colorBlue,styleLine); -- Cheers Graham AB-Write Professional AFL Writing Service Yes, I write AFL code to your requirements

[amibroker] Plot shapes Plot text question

2007-01-10 Thread James
Is there anyway to label the arrows in plotShapes? What I have in mind is a simple code, 3 or 4 letters right below an up arrow or above a down arrow so that you could have several systems overlayed on a chart and the label would tell you which system was indicating a buy or sell. James

[amibroker] Re: loop counter

2007-01-10 Thread wlandry01
Terry, Your code example illustrates on something that I do not understand about QuickAFL. It would seem to me that the line: x = BarIndex(); would create an array containing a value for every bar in the database and that QuickAFL would, therefore, load all array values in order to perform

[amibroker] Re: Plotting Horizontal Lines

2007-01-10 Thread trb0428
Bill, Use the regular plot function instead of plotgrid: Plot(LastValue( TodaysMidPoint ),,colorDarkRed,styleline); regards, Tom --- In amibroker@yahoogroups.com, Bill Halliday [EMAIL PROTECTED] wrote: I'm trying to plot a horizontal line on an Intraday Price Chart. Here is the formula I'm

[amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread trb0428
Hi Graham, I am using the Osaka plugin to rank and sort a list of stocks. From this, I am trying to create an indicator which will display the rank of the stock for each bar. I have 200 symbols that I am sorting and rankng. Below is the code I am using to read from the Osaka table into a

Re: [amibroker] Re: Plotting Horizontal Lines

2007-01-10 Thread Bill Halliday
Oh, how simple. Thank you Tom. Chester trb0428 [EMAIL PROTECTED] wrote: Bill, Use the regular plot function instead of plotgrid: Plot(LastValue( TodaysMidPoint ),,colorDarkRed,styleline); regards, Tom --- In amibroker@yahoogroups.com, Bill Halliday wrote: I'm trying to plot a

[amibroker] Pairs Trading Backtesting - Help!

2007-01-10 Thread KBGlenn
Does anyone know how to backtest a long-short pair? I built my own indicators and code for the buys and sells but I don't know how to backtest two stocks simultaneously...I don't think Amibroker can do this, but is there a way around it? Tks!

Re: [amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread Graham
If you need the value for every bar then you will need to run the ranking for every bar, including creating the data files for every bar. ie within a loop There are some sort and rank AFL in a library that allow similar ranking using staticvarget, but again these will need changing to within a

Re: [amibroker] Re: loop counter

2007-01-10 Thread Tomasz Janeczko
Hello, I was under the impression that QuickAFL loads bars depending on what is needed to do the calculations in the code Your impression was and is correct. But what is needed to do calcs depends on zoom range, functions used, and other factors. I explained it in more details on

RE: [amibroker] Plot shapes Plot text question

2007-01-10 Thread J. Biran
currently the only way to achieve what you want is using PlotShapes and then PlotText. the problem is that it is hard to line up vertically the 2. sometimes they will overlap, others they will be spaced too far apart depending on the chart size. maybe you should add another suggestion to the

RE: [amibroker] Re: loop counter

2007-01-10 Thread Terry
Why do you want a loop to do this? Code supplied already does this in two lines much faster. x = BarIndex(); Plot(x,x,1,styleStaircase); Answer to your question anyway: bi= BarIndex(); qty = LastValue( bi ); for (i = 0; i qty; i++) ... -- Terry -Original Message- From:

[amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread trb0428
Graham, Thanks. I find the sorting and ranking within the Osaka routines to be very fast. I am going to try saving a binary version of the table created using Osaka and then from within my indicator code recall and load the table into memory and index into it for just the rank of the ticker I

Re: [amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread Graham
sorting a single symbol over X bars is OK for speed, or for single bar between symbols is not bad for speed. From what i saw of your loop code you were wanting to sort over a watchlist of 200 symbols, for each symbol against every other symbol for every bar. This will be very very slow --

[amibroker] colour change

2007-01-10 Thread paulradge
hi all, can some please tell me how to change the colour of the trendline indicators and also the Fib line indicator thats in the tool bar,,,would also like to change the colour of the text in the abc indicator ,please. Paul

Re: [amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread Ara Kaloustian
Tom You can certainly store data inan array element by element MyArray[0] = dataelement1; MyArray[1] = dataelement2; MyArray[2] = dataelement3; etc Plot(MyArray,); if you put your dataelements in dynamic variables first, then you can put them in an array easily for (i=0; imaxelement;

RE: [amibroker] Plot shapes Plot text question

2007-01-10 Thread Terry
Not with PlotShapes, but with PlotText. Beware that using a lot of PlotText is quite slow. -- Terry -Original Message- From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of James Sent: Wednesday, January 10, 2007 15:36 To: amibroker@yahoogroups.com Subject:

RE: [amibroker] Backtest Results

2007-01-10 Thread Terry
At the bottom of the AA results screen? If so, these are the number short trades and long trades in the current backtest. -- Terry -Original Message- From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of troll Sent: Wednesday, January 10, 2007 13:40 To:

[amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread trb0428
Ara, ThanksI will give it a try. regards, Tom --- In amibroker@yahoogroups.com, Ara Kaloustian [EMAIL PROTECTED] wrote: Tom You can certainly store data inan array element by element MyArray[0] = dataelement1; MyArray[1] = dataelement2; MyArray[2] = dataelement3; etc

RE: [amibroker] colour change

2007-01-10 Thread Terry
Draw one. Right click it and choose Properties. Adjust the colors. Be sure to click set to default or similar checkbox. -- Terry -Original Message- From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of paulradge Sent: Wednesday, January 10, 2007 18:43 To:

[amibroker] Re: DDE Excel

2007-01-10 Thread treliff
Tomasz, thanks for your ref. to ODBC plugin, I have to look into this, am unfamiliar with this right now. Re. DDE the reason for using Excel in between External Data and AmiBroker (by 2 DDE links) is that by connecting directly: External Data -DDE (plugin)-AmiBroker there would be no room for

Re: [amibroker] colour change

2007-01-10 Thread paulradge
Hi Terry, many thanks ,,, i have that sorted out now ,,, thanks again, Paul Draw one. Right click it and choose Properties. Adjust the colors. Be sure to click set to default or similar checkbox. -- Terry -Original Message- From: amibroker@yahoogroups.com

Re: [amibroker] Pairs Trading Backtesting - Help!

2007-01-10 Thread cstrader
Can't you just create the difference of the long/short pair by reading one of them using the foreign() function? for instance: spread = (Close -Foreign(, Close)); - Original Message - From: KBGlenn [EMAIL PROTECTED] To: amibroker@yahoogroups.com Sent: Wednesday, January 10, 2007

[amibroker] Random Walk Index -- raw AFL code request

2007-01-10 Thread brpnw1
I am looking for the underlying formula for the Random Walk Index. I would like to tweak my RWI indicators to my own liking, but find that in order to do this properly, I need the underlying AFL formula. Does anyone have some code they can throw at me for this? Thanks in advance! ~Bman

Re: [amibroker] Backtest Results

2007-01-10 Thread Jerry Laster
If it's in the trade description, it's because the exit is due to a stop, not a signal. On Wed, 10 Jan 2007 15:39:56 -0500, troll [EMAIL PROTECTED] wrote: Minor question but unable to find anything in the reference material, settings or help files. Now getting Short(21), Long(15) (or some

[amibroker] Scan Sell Signal with ApplyStop

2007-01-10 Thread Ernie Newman
If my script ends with the following code using Sell = 0 as I want to use the stops for an exit. How does the scan function give me a sell signal the day before the signal as I will exit the trade the next day at the open. The buy scan works great but there is no sell signals. If the trade is 9

Re: [amibroker] Scan Sell Signal with ApplyStop

2007-01-10 Thread Graham
you may need to add Equity(1,0); line to the code to give the stops values for scan and plots see equity in help for the numbers to use inside the brackets -- Cheers Graham AB-Write Professional AFL Writing Service Yes, I write AFL code to your requirements http://www.aflwriting.com On

[amibroker] AlertIf question

2007-01-10 Thread Chris DePuy
Can I get AlertIf to send me an email when its placed into indicator code using frequently refreshed yahoo data (eg delayed intraday retrieved every 2 minutes?) I know how to get AlertIf working using AA/Scan, for instance. Once a scan is found true, then the AlertIf command sends the email.

[amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread trb0428
I have almost got his working except for the following: the indicator that I am plotting disappears and re-appears on alternating clicks of my mouse I have tried hardcoding numbers in place of Barcount and I have tried adding the line : SetBarsRequired(1,1); but with no difference.

Re: [amibroker] Re: Are dynamic arrays possible in AB?

2007-01-10 Thread Graham
Just a general note, if one of the symbols does not have a bar on a certain date but the rest do it can cause problems I find it better to use datetime, or datenum if only end of day, for the bar identification instead of barindex -- Cheers Graham AB-Write Professional AFL Writing Service Yes,