[amibroker] Scan or Exploration

2010-04-23 Thread JEFF F
I am trying to create either a scan or exploration (not sure which works better) for the following criteria: Calculate the lowest close for a stock in last 260 days. If a stock has less than 260 days data calculate lowest close for those many days. Calculate percent change from lowest close and

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread graphman27
Thanks - Will do. Hopefully, there's an answer out there. Selling all at once cuts down on my expected returns. --- In amibroker@yahoogroups.com, "Mike" wrote: > > Play around a little and see what happens. The sell all behavior might have > been just when having used sigScaleIn, or it might

Re: [amibroker] Re: S&P GICS clasifications

2010-04-23 Thread Howard B
Hi Ara -- According to information from Norgate Premium Data, they will will have GICS data real soon now. Richard Dale, who often posts here, is their contact. Thanks, Howard On Fri, Apr 23, 2010 at 12:54 AM, Paolo wrote: > > > > http://www.amibroker.org/userkb/2008/03/25/ascii-import-stand

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread Mike
Play around a little and see what happens. The sell all behavior might have been just when having used sigScaleIn, or it might apply for all conditions. I haven't checked. If it is the case, then sigScaleOut would likely be easier than custom backtesting. Keep your fingers crossed, and someone

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread graphman27
Thanks as always - Although the solutions offered are a bit over my my limited programming abilities. I'll tinker around with that and see if I can use it for a fix. Otherwise, I may have to come up with a workaround or change the actual symbols being used. Thanks again though - You're a walk

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread Mike
Ha ha, I was waiting for that one. Unfortunately, it's not that easy. I seem to recall that AmiBroker will consider the multiple entries as a single positions, as far as Sell is concerned, and will thus exit your entire position upon any Sell signal. However, if my suspicion proves to be corre

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread graphman27
As I said previously, the buys are all working correctly, but all the sells are triggered simultaneously on the same day, which can't be right. I must be missing something, but I'm close Strategy1_Buy = Buy = Cross(StochFinal,Trigger) AND (EMA( Close,EMAShort ) > EMA( Close,EMALong )); St

Re: [amibroker] Re: AFL Learning Curve

2010-04-23 Thread Keith McCombs
Benjamin -- Previously, you mentioned other programming languages. IMHO, trying to learn from them either before or during your efforts with AB, will just add to possible confusion and slow you down. Just concentrate on AB. That will work best. -- Keith On 4/23/2010 08:12, Benjamin wrote:

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread graphman27
You are the man! You've been incredibly helpful. I got most of what you are saying to do, added/changed the code and started getting 1, 2 & 3 positions at a time! Awesome! Due to the fact that I can see the buy signals are being triggered on different days (perfect) and I see all the Sell si

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread Mike
Hi, You're problem is that you are doing exactly what I said not to do. You must alter your code to produce an intermediate result for each case, then OR the results togeather. if ( n == "S&PEmrgMkts" ) { ... Strategy1_Buy = ...} if ( n == "S&PEmrgMkts" ) { ... Strategy2_Buy = ...} if ( n == "S

[amibroker] Optimizing Option Spreads

2010-04-23 Thread Rick
I used Amibroker years ago and loved the program. However I have been out of touch with it. I trade call and put credit spreads, Iron Condors, Butterflies etc in equity and indexes. I would like to know: Are complete option chains available for backtesting? Do these option chains include the

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread graphman27
Here's is most of the code in question... SetBacktestMode( backtestRegularRawMulti ); SetOption("MaxOpenPositions", 3 ); // This sets maximum number of open positions //PosQty = 3; // You can define here how many open positions you want //SetOption("MaxOpenPositions", PosQty ); //PositionSize =

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Keith McCombs
TJ -- Excellent!!! I got it now. Thank you for your explanation and your patience with me. -- Keith On 4/23/2010 14:23, Tomasz Janeczko wrote: Hello, "One might assume, for speed sake, that no temporary array would be created for H/2 or Ref(H, -1). " No. It does not matter what calculatio

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread Mike
Without a code sample, it's hard to understand what you are saying. But, bottom line is that you must have a single Buy statement which includes all the logic of all the formulas. e.g. Strategy1_Buy = ... Strategy2_Buy = ... Buy = Strategy1_Buy OR Strategy2_Buy; // Correct You cannot have mult

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Tomasz Janeczko
Hello, "One might assume, for speed sake, that no temporary array would be created for H/2 or Ref(H, -1). " No. It does not matter what calculation you do, the evaluation of ANY expression involves allocating memory for the result (i.e. it can be called "temporary variable" although it is o

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Keith McCombs
TJ -- Thank you for Explicitly saying, "There is NO difference what is on the left side . It does not matter if expression includes same variable as on right side. The entire (right-side) expression is FIRST EVALUATED COMPLETELY (all bars at once) and AFTER that resulting ARRAY is assigned."

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Tomasz Janeczko
Correction: "entire (left-side) expression" should read "entire (right-side) expression". On 2010-04-23 19:05, Tomasz Janeczko wrote: Hello, There is NO difference what is on the left side . It does not matter if expression includes same variable as on right side. The entire (left-side) expres

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Tomasz Janeczko
Hello, There is NO difference what is on the left side . It does not matter if expression includes same variable as on right side. The entire (left-side) expression is FIRST EVALUATED COMPLETELY (all bars at once) and AFTER that resulting ARRAY is assigned. If you read http://www.amibroker.co

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Keith McCombs
Mike -- Yes, temporary arrays are discussed on the link you referred to. However, the link does not explicitly discuss the situation where the the same array is on both left and right side of an equation, as in Buy = Ref(Buy, -1). It does implicitly discuss it with the AMA(Close, Factor) exam

[amibroker] Re: linear regression function

2010-04-23 Thread reefbreak_sd
This is a Linear Reg fit using the equations from "Standard Math Tables" published by CRC. The Y axis uses the array 'Prc', the X axis uses the array 'X'. You can put any values you want into those two arrays. To get it to work you need to 'Insert' it into a Chart Window then click on the

[amibroker] More on VSA Group

2010-04-23 Thread Richard
Thanks all for joining the new Yahoo Amibroker Group "Amibroker-VSA". As of this Morning we have had over 130 join our group. Your interest and participation will be most appreciated. To find us go to:http://finance.groups.yahoo.com/group/amibroker-vsa/ Dick Hoierman

[amibroker] Re: Need multiple positions per symbol in portfolio

2010-04-23 Thread graphman27
I downloaded 5.30 and still can't get it to work. What I do see is mutiple positions for one symbol IF there is only one signal formula for a symbol. I have three separate formulas for one symbol, which doesn't seem to work with BacktestRegularRawMulti. I scanned through the detailed log and

[amibroker] Re: What's a simple way to get back in after stop but no new buy signal?

2010-04-23 Thread graphman27
Thanks for your help. I've been trying to come up with an "OR" additional signal for re-entry. Steve. --- In amibroker@yahoogroups.com, "Mike" wrote: > > You would have to include the reentrant logic in your Buy. If already in a > position, the backtester will ignore the redundant Buys. If th

[amibroker] Re: Amibroker VSA

2010-04-23 Thread Richard
Paolo, Sorry about that ... correct address is: http://finance.groups.yahoo.com/group/amibroker-vsa/ Dick --- In amibroker@yahoogroups.com, "Paolo" wrote: > > I get the message: > > Group Not Found > There is no group called amibrokervsa > > --- In amibroker@yahoogroups.com, Keith McCombs wro

Re: [amibroker] Ruin Stop is activated in irrelevant trades

2010-04-23 Thread Ilhan Ketrez
Pleeease help... :) 2010/4/20 Ilhan Ketrez > > [Attachment(s) <#1281c1bc62b75af9_TopText> from Ilhan Ketrez included > below] > > Hello > > Ruin Stop is activated in irrelevant trades as far as I see. It happens in > *some* negative price values of a continuous contract. > > Trade list & AFL co

[amibroker] Re: AFL Learning Curve

2010-04-23 Thread Benjamin
Guys, Thanks so much for the info! Looks like I have some work ahead of me. Sorry so late with a reply. Benjamin --- In amibroker@yahoogroups.com, "Paolo" wrote: > > Hi Benjamin, > > AB has a never ending learning curve :-) > > Having said that I agree with Herman that't plenty of support

Re: [amibroker] Re: Confusion with an array referencing itself.

2010-04-23 Thread Tomasz Janeczko
Hello, A must read for everyone wanting to write AFL formulas: http://www.amibroker.com/guide/h_understandafl.html Read slowly and analyse the example tables that are included in that article, it will help you understand. Best regards, Tomasz Janeczko amibroker.com On 2010-04-23 06:56, Keith

Re: [amibroker] bars between dates?

2010-04-23 Thread Tomasz Janeczko
Hello, bi = BarIndex(); bi1 = ValueWhen( DateNum() = ..date1.. , bi ); bi2 = ValueWhen( DateNum() = ..date2.. , bi ); numbars = LastValue( bi2 - bi1 ); Best regards, Tomasz Janeczko amibroker.com On 2010-04-23 12:09, inquisitive2007 wrote: (1)does any body tell me how to count no. of ba

Re: [amibroker] Re: How to use AUX1 and AUX2?

2010-04-23 Thread Tomasz Janeczko
Hello, See my previous response - you can't write composite to the very same symbol. With regards to temporary variables - you should definitely use STATIC variables instead for that purpose. They are much faster than composites. Best regards, Tomasz Janeczko amibroker.com On 2010-04-23 11

Re: [amibroker] Re: How to use AUX1 and AUX2?

2010-04-23 Thread Tomasz Janeczko
Hello, These fields are mainly for READING from AFL. If you want to write to them you need new composite ticker (AddToComposite() function). With regards to writing to "current" ticker - my previous response was not entirely correct - composites won't add to themselves, otherwise the composi

[amibroker] Re: Taking 2 Trades in 1 Bar

2010-04-23 Thread Pmxgs
Hello, usually what I do is to create indicators using timeframe functions and then run the backtest using the finest resolution I have, which does the same thing as what you are referring to (Inside-Bar Back-testing). For example in a breakout system I create the highest highest based on hour

[amibroker] Re: Taking 2 Trades in 1 Bar

2010-04-23 Thread Pmxgs
Hello Angelo, sorry I missed your reply to my post. My system is a bit different from what you're trying to do, basiccally what I wanted was to scale into positions. The system I used with "backtestRegularRawMulti" had entry conditions at fixed price intervals(same as sigscalein) the only dif

[amibroker] Re: Question about accessing a specific value in an array

2010-04-23 Thread polomorabe
Thanks Ara. --- In amibroker@yahoogroups.com, "Ara Kaloustian" wrote: > > Try Norm_SP500 = SP500 / LastValue(Ref(SP,-13)); > > This should give you the value of 13 bars from the end of the array as the > divisor > > - Original Message - > From: "polomorabe" > To: > Sent: Wednesday,

[amibroker] bars between dates?

2010-04-23 Thread inquisitive2007
(1)does any body tell me how to count no. of bars between 2 dates in commentary? (2)I mean, if a function be made accepting 2 arguments as date and which should calculate bars between them. regards PS:plz dont tell me the way by selecting a range in the chart using selectedvalue,firstvalue,

[amibroker] Re: How to use AUX1 and AUX2?

2010-04-23 Thread Pmxgs
Hello, I know that these fileds should store data imported through ascii files, butis it possible to store values to these fields during a the first phase of the backtest backtest and access them in the second phase. for example: Aux1=ATR(14); thanks

[amibroker] Re: Amibroker VSA

2010-04-23 Thread Paolo
I get the message: Group Not Found There is no group called amibrokervsa --- In amibroker@yahoogroups.com, Keith McCombs wrote: > > So, Dick, wouldn't have been real easy to have just gone ahead and > supplied a link to the group? > http://finance.groups.yahoo.com/group/amibrokervsa/ > > Notic

[amibroker] Re: AFL Learning Curve

2010-04-23 Thread Paolo
Hi Benjamin, AB has a never ending learning curve :-) Having said that I agree with Herman that't plenty of support materials you can find all over the place...the point is that when you are learning you may get confused by all this material. I wuld then recommend what TJ always says...look at

[amibroker] Re: multiple currency support

2010-04-23 Thread Paolo
This is something I've been willing to check for ages but never had the time to do. Very curious to know what comes out since I have your same needs. Paolo --- In amibroker@yahoogroups.com, "tf28373" wrote: > > Hi > > As I plan to trade different currency pairs live, I have been trying to > p

[amibroker] Re: Taking 2 Trades in 1 Bar

2010-04-23 Thread Paolo
Hello everybody, a long time ago I posted something about a requested upgrade of AB including something other competitors have already included for ages which is usually called "Use Look-Inside-Bar Back-testing" which automatically check the chronological order of prices using the lowest granul

[amibroker] How does amibroker takes the OPEN price of a bar

2010-04-23 Thread Prabu
Hi, I have some data like this.. Date, Time, Price 06/01/2009,095501,4509 06/01/2009,095504,4511 06/01/2009,095513,4507 AmiBroker takes 4511 as the Open price instead of 4509 Any one have any idea why it is so..? or any configuration should be changed..? Thanks.

[amibroker] Re: S&P GICS clasifications

2010-04-23 Thread Paolo
http://www.amibroker.org/userkb/2008/03/25/ascii-import-standard-and-poors-global-1200/ Let me know if it helps, Paolo --- In amibroker@yahoogroups.com, "Ara Kaloustian" wrote: > > Does anyone know where I can find a list of stocks with their GICS codes so I > can import them into AB? > > Tha