[amibroker] Re: Getting Today

2007-10-18 Thread jeffro861
In automatic analysis look under "Range" and select n last days and put a 1. You might also need to look under settings in automatic analysis and select the "portfolio" tab and choose the option for future data. Good luck, JH --- In amibroker@yahoogroups.com, Conrad Smith <[EMAIL PROTECTED]>

[amibroker] Getting Today

2007-10-18 Thread Conrad Smith
Hi guys, I'm trying to write an exploration that finds the stocks where the MACD fast MA crosses down the slow MA and the signal is more than 0. I've come up with this so far: Mac1 = MA(Close, 12); Mac2 = MA(Close, 26); Filter = Cross(Mac2, Mac1) AND (Mac2 - Mac1) > 0; AddColumn( Close, "Clo

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread tipequity
Tomasz, did you try the code below. Beside couple of spelling error which I fixed, I get other error messages. When I fix them I don't get the intended results. The buy can sell conditions can be any generic conditions such as Buy = Close>0; Sell = Close > Ref(Close, -1); Regards Kam --- In

[amibroker] Re: Flags to get industry data from yahoo

2007-10-18 Thread vgakkhar
Sorry, I could not locate the template. Can you please provide me its copy or link. Secondly, if I want to use this template for Indian stocks, what should I do? Thanks, vgakkhar --- In amibroker@yahoogroups.com, "areehoi" <[EMAIL PROTECTED]> wrote: > > All you need to do is download the

[amibroker] Re: how to plot a secant

2007-10-18 Thread murthysuresh
thanks it works ThisIsLastBar = BarCount-1 ; _TRACE("ABTEST VALE OF BAR COUNT " + WriteVal(ThisIsLastBar )); y1=LastValue(ADX()); ADXhistory=Ref(ADX(),-10); y0=ADXhistory[ThisIsLastBar]; x0=ThisIsLastBar-10; x1=ThisIsLastBar; //WriteVal(y0) + "\n"; //WriteVal() + "\n"; //Title=y1[ThisIsLastBar

[amibroker] Re: not sure why i get this subscript out of range error

2007-10-18 Thread murthysuresh
My bad. my code had y1=Ref(ADX(),3); which was looking into the future. thanks for responding. --- In amibroker@yahoogroups.com, "mac_bosh" <[EMAIL PROTECTED]> wrote: > > Try ... > ThisIsLastBar = BarCount-1; > > --- In amibroker@yahoogroups.com, "murthysuresh" wrote: > > > > My logic finds t

Re: [amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread Tomasz Janeczko
Seems like one closing brace was missing ApplyStop( stopTypeNBar, stopModeBars, 15 ); // exit after 15 days SetBacktestMode( backtestRegularRaw ); SetCustomBacktestProc(""); MaxBuys = 3; if( Status("action") == actionPortfolio ) { bo = GetBacktesterObject(); bo.PreProcess(); fo

Re: [amibroker] Re: 3D graph readability comparison

2007-10-18 Thread Tomasz Janeczko
Hello, You may try to turn off "Anti-alias" feature (the button with letter "A" in the toolbar of 3d graph viewer). If this helps, it means that your graphic card has problems with full screen anti-aliasing and you should upgrade its drivers. Best regards, Tomasz Janeczko amibroker.com - Or

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread tipequity
Thanks Tomasz for helping, I will give it try. More than that thanks for explaining the code with comments. Learning AB is significantly more import to me than solving the problem at hand. --- In amibroker@yahoogroups.com, "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > Hello, > > The first s

Re: [amibroker] MACD Histogram

2007-10-18 Thread David LW
Hi Roger, Thank you so much for the time :) Regards David Roger <[EMAIL PROTECTED]> wrote: Hi David I only trade futures. Have never used the scan feature of Amibroker and I am not a programmer. Just do some cut and paste from one formula to another. I lo

[amibroker] Re: 3D graph readability comparison

2007-10-18 Thread rollyzhang
Hi Tom, I am interested but couldn't find your screenshot. How do I view message attachments? Btw, my 3D Graph Viewer displays blank screen. This happened after upgrading to AB5.0. Is there a place enabling the feature? Thanks, Rolly

[amibroker] Re: More problems

2007-10-18 Thread jeffro861
Hi TJ, That's what I had originally and it didn't work. In this particular code, I was just trying anything. JH --- In amibroker@yahoogroups.com, "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > You need to do this the other way round. > FIRST SetForeign > and THEN any TimeFrame***() function

Re: [amibroker] Re: More problems

2007-10-18 Thread Tomasz Janeczko
You need to do this the other way round. FIRST SetForeign and THEN any TimeFrame***() functions. Best regards, Tomasz Janeczko amibroker.com - Original Message - From: "jeffro861" <[EMAIL PROTECTED]> To: Sent: Friday, October 19, 2007 1:07 AM Subject: [amibroker] Re: More problems > H

Re: [amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread Tomasz Janeczko
Hello, The first step to success is to describe the goal, not the step you are locked on. This is I belive the very first time when you actually described the goal. Once this is establish the rest is easy. ApplyStop( stopTypeNBar, stopModeBars, 15 ); // exit after 15 days SetBacktestMode( b

[amibroker] Re: More problems

2007-10-18 Thread jeffro861
Hi Graham, I took all the time functions out except for timeframeexpand() in the plots, and the resulting indicators were the same as the following code. As you can see I put timeframerestore() before restorepricearrays()-- I think that's what you meant. In any case,the code with and without

[amibroker] Re: not sure why i get this subscript out of range error

2007-10-18 Thread mac_bosh
Try ... ThisIsLastBar = BarCount-1; --- In amibroker@yahoogroups.com, "murthysuresh" <[EMAIL PROTECTED]> wrote: > > My logic finds the barcount and then tries to access the bar which is > barcount -10. Not sure why i get this error. i have enough history info > to be able to see (barcount-10)th

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread tipequity
Tomasz, GP I have no desire to use low level. I am perfectly happy to use the regular backtester. I am trying to port my trading system to AB. What I need to achieve is as follows which I could not do in regular backtester (assuming a long only EOD system). 1. limit the number buys to 4 per d

Re: [amibroker] not sure why i get this subscript out of range error

2007-10-18 Thread wavemechanic
What is the rest of the code? Bill - Original Message - From: "murthysuresh" <[EMAIL PROTECTED]> To: Sent: Thursday, October 18, 2007 4:29 PM Subject: [amibroker] not sure why i get this subscript out of range error > My logic finds the barcount and then tries to access the bar which

[amibroker] Re: Referring to an array of a specific stock

2007-10-18 Thread Mike
Have a look at the Foreign function in the language reference: http://www.amibroker.com/guide/afl/afl_view.php?id=54 --- In amibroker@yahoogroups.com, "mikeleekc" <[EMAIL PROTECTED]> wrote: > > Hi there, > Is there a function that I can refer to a specific stock in my AFL code? > Eg. I want t

[amibroker] Re: not sure why i get this subscript out of range error

2007-10-18 Thread murthysuresh
Hello GP I am afraid, i dont agree. I am running it as indicator and you can see the screenshot that there is enough data for it to fill the array. http://img266.imageshack.us/my.php?image=subscriptrangeerrorsc5.png The trace statemetn shows 2740 as the length of the array. --- In amibroker@ya

Re: [amibroker] Re: More problems

2007-10-18 Thread Graham
you do need to add timeframerestore(); at the end of the compressed section -- Cheers Graham Kav AFL Writing Service http://www.aflwriting.com On 19/10/2007, jeffro861 <[EMAIL PROTECTED]> wrote: > Okay I added setbarsrequired and now the values are the same, but not > it's not matching up to t

[amibroker] Re: Accessing the current "Buy/Short" value during backtesting??

2007-10-18 Thread Mike
Try Ref(Buy, 0) and see if that works for you. I don't have access to AmiBroker on this computer, so I can't say for sure if it will work. But it should be easy to try. --- In amibroker@yahoogroups.com, "cnh4_2000" <[EMAIL PROTECTED]> wrote: > > I'm backtesting a system which requires me to take

[amibroker] Re: Accessing the current "Buy/Short" value during backtesting??

2007-10-18 Thread gp_sydney
What exactly are you trying to achieve? Are Value1 and Value2 constants or arrays? Is ProfitFactor supposed to be constant during the backtest based on some particular bar's buy/short values, or should it also be an array that potentially changes every bar? >From what you're asking in your first p

Re: [amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread Tomasz Janeczko
Exactly. In low-level mode AmiBroker does NOT enter/exit ANY trades unless you tell it to do so by calling EnterTrade/ExitTrade. Entire signal processing is upto the user. Beginners should rather avoid using custom backtester esp. low-level mode unless they are programmers and know exactly what t

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread gp_sydney
If you're using the low-level CBT, then you're entering and exiting trades yourself, so I don't see how there can be "phantom" trades that you don't know about. Maybe the issue is with your Buy and Sell arrays. If you get a buy signal on one bar but don't take it, it won't still show up as a signa

[amibroker] Re: not sure why i get this subscript out of range error

2007-10-18 Thread gp_sydney
Are you running this over a single stock that you know has more than 10 bars, or over a whole list of stocks? It looks to me like the stock giving the error doesn't have at least 11 bars. Try adding a _TRACE statement for BarCount and see what shows up in DebugView. Regards, GP --- In amibroker

[amibroker] Re: More problems

2007-10-18 Thread jeffro861
Okay I added setbarsrequired and now the values are the same, but not it's not matching up to the relstrength() function. --- In amibroker@yahoogroups.com, "jeffro861" <[EMAIL PROTECTED]> wrote: > > I changed the code to the following and now I have another problem. > When I do an exploration f

[amibroker] not sure why i get this subscript out of range error

2007-10-18 Thread murthysuresh
My logic finds the barcount and then tries to access the bar which is barcount -10. Not sure why i get this error. i have enough history info to be able to see (barcount-10)th value. ThisIsLastBar = LastValue( BarIndex() ); y0=LastValue(ADX()); y1=Ref(ADX(),3); WriteVal(y0) + "\n"; WriteVal(

[amibroker] More problems

2007-10-18 Thread jeffro861
I changed the code to the following and now I have another problem. When I do an exploration for the values of the plotted lines, my values are different than my the indicators. I also noticed that when I "apply" the indicator to the chart, the values are the same as the exploration, but when I c

[amibroker] Re: Date Axis Question

2007-10-18 Thread steve_almond
I should have said that I'm using version 4.67 Steve --- In amibroker@yahoogroups.com, "steve_almond" <[EMAIL PROTECTED]> wrote: > > I'm using EOD data. The date (X) axis shows only the month value, no > matter how much I zoom the scale in using 'daily view'. > Can I make intermediate dates vis

[amibroker] Date Axis Question

2007-10-18 Thread steve_almond
I'm using EOD data. The date (X) axis shows only the month value, no matter how much I zoom the scale in using 'daily view'. Can I make intermediate dates visible along the X axis? Steve

Re: [amibroker] Money management schemes

2007-10-18 Thread Ton Sieverding
Frankly I really do not see any problem to implement 'Kelly's Optimal F' in AFL John. Question is of course what you want to do with the result ... Regards, Ton. - Original Message - From: [EMAIL PROTECTED] To: amibroker@yahoogroups.com Sent: Thursday, October 18, 2007 4:26 PM

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread rdavenportca
Tomasz, Is it possible to eliminate these phantom positions per the original question? If not, I don't want to waist my time trying to figure it out. Maybe you can put it down on your probably massive list of future features/fixes. --- In amibroker@yahoogroups.com, "Tomasz Janeczko" <[EMAIL

Re: [amibroker] how to plot a secant

2007-10-18 Thread wavemechanic
You can use linearray() Bill - Original Message - From: "murthysuresh" <[EMAIL PROTECTED]> To: Sent: Thursday, October 18, 2007 11:46 AM Subject: [amibroker] how to plot a secant > hello > How can i plot a secant. I want to plot a secant that intersects > lstvalue(adx()) and ref(adx(

Re: [amibroker] MACD Histogram

2007-10-18 Thread wavemechanic
OK, here is a simplified version that you can add to: First, let's be clear on your condition. As I understand, you want to buy when have 4 consecutive (I assume) down histogram bars followed by an up histogram bar plus MACD() > 0 and RSI() > 30. If so, cut and paste the following in Formula

[amibroker] Retrieve function in broker.application for VB 2005 (VB.NET)?

2007-10-18 Thread rutle1
The following function: Function Retrieve(ByVal Count As Long, ByRef Date As Variant, ByRef Open As Variant, ByRef High As Variant, ByRef Low As Variant, ByRef Close As Variant, ByRef Volume As Variant, ByRef OpenInt As Variant) As Long The problem is that the variant datatype is not valid anymor

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread tipequity
Thanks Edward for your response. I have read & re-read the setbacktestmode options several times. Unless I am missing something, my take on what SetBacktestMode( backtestRegularRaw )means is that it would use redundant signal one time to make a buy. Subsequent to that buy not pyramiding or scal

[amibroker] Re: Flags to get industry data from yahoo

2007-10-18 Thread areehoi
All you need to do is download the Template and/or Excel file provided by Jim Swindle - Message # 115896. You are trying to do it the hard way. Dick H. --- In amibroker@yahoogroups.com, "firefly" <[EMAIL PROTECTED]> wrote: > > Hello, > > i need a flag for the homepage of yahoo to call for

Re: [amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread Tomasz Janeczko
Hello, It marks that given signal should be ignored. Best regards, Tomasz Janeczko amibroker.com - Original Message - From: "tipequity" <[EMAIL PROTECTED]> To: Sent: Thursday, October 18, 2007 5:12 PM Subject: [amibroker] Re: Eliminating Phantom Positions in CBT > What does signal.Pri

[amibroker] how to plot a secant

2007-10-18 Thread murthysuresh
hello How can i plot a secant. I want to plot a secant that intersects lstvalue(adx()) and ref(adx(),-3) and determine the slope. GFXLINETO function takes in pixel co ordinates only. so is there a way to get convert the ref(adx(),-3) into x,y co ordinates? seede

[amibroker] Flags to get industry data from yahoo

2007-10-18 Thread firefly6666
Hello, i need a flag for the homepage of yahoo to call for the industry info which can be used to assign the correct industry group for the symbols. The following link describes some flags which can be used with yahoo but i have not found the flag for calling for the industry group. http://www.gum

Re: [amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread Edward Pottasch
did you look at SetBacktestMode( backtestRegularRaw ); SetBacktestMode( backtestRegularRawMulti ); here an example: http://www.mail-archive.com/amibroker@yahoogroups.com/msg17297.html or http://finance.groups.yahoo.com/group/amibroker/message/112781 you may use redundant signals rgds, ed

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread tipequity
What does signal.Price = -1 do? What does it test? I saw it in the following code by TJ http://www.amibroker.com/kb/2006/04/24/using-redundant-signals-for- entries/ --- In amibroker@yahoogroups.com, "rdavenportca" <[EMAIL PROTECTED]> wrote: > > I've tried everything I can think of to "null" the

[amibroker] Re: Eliminating Phantom Positions in CBT

2007-10-18 Thread rdavenportca
I've tried everything I can think of to "null" the phantom positions. I'm working with the low level CBT such that I can execute trades manually. I can keep track of which symbols should be reset. I've tried setting signal.Price = -1 (both entry signals and exit signals), signal.PosSize = 0,

Re: [amibroker] MACD Histogram

2007-10-18 Thread Roger
Hi David I only trade futures. Have never used the scan feature of Amibroker and I am not a programmer. Just do some cut and paste from one formula to another. I look at most posted afls just to make sure a good idea doesn't slip by! Be sure to ask the forum again if the scan still doesn't wo

[amibroker] Money management schemes

2007-10-18 Thread trader
All, This may sound like a dumb question but has anyone implemented money management schemes, specifically Optimal F, for AMIBroker? Optimal F is sufficiently complex that I doubt it could be coded in AFL so is there a way to extend AMIBroker to accomodate such things? -- John

[amibroker] Accessing the current "Buy/Short" value during backtesting??

2007-10-18 Thread cnh4_2000
I'm backtesting a system which requires me to take action #1 if BUY was true(and SHORT was false) and take action #2 if SHORT was true (and BUY was false). Obviously, this evaluation is done after after the BUY and SHORT signals are checked. Here are the different things I've tried which all do

[amibroker] Re: how to run backtest automatically

2007-10-18 Thread itmwh
--- In amibroker@yahoogroups.com, "itmwh" <[EMAIL PROTECTED]> wrote: > > Hi, I have a question. I trade a futures strategy everyday, I usually > stop trading if the daily loss has surpassed a predetermined amount. > Currently I am running backtest from time to time during the day, I > want to kn