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

Re: import data with neg value



PureBytes Links

Trading Reference Links

Stephane, 

Hello.

I had a similar problem and learned that the current AB import 
wizard only accepts positive numbers for the price fields. 
Apparently the price fields (O,H,L,C) will hold negative values 
inside AB, but the import wizard is not currently set up to let 
negative numbers get inside. This does make sense because no stock 
should have a negative value. Perhaps the new import wizard for AB 
4.0 will solve this problem. Until then here are a couple of work-
arounds to try.

Try importing the data into the Volume or OI arrays. I think these 
might accept negative numbers, but I am not sure. V and OI are 
integer only fields so any decimals will not be imported. If you 
only need 1 or 2 arrays this is the easiest way. I am not sure if 
the V and OI are regular integers (if so the maximum number would be 
just over 32000) or are extended integers (which would likely accept 
numbers in the millions). A simple import test should answer this.

The second approach is more work but it will let you put negative 
data into the price arrays. Here are the steps to take:

1. Before importing, add a LARGE number to you data. If the largetst 
negative number is -123456 then add 1000000 which will give 876544. 
If the data is coming from a spreadsheet adding an "outset" number 
should be easy.

2. Import into the OPEN array or which ever price array you wish 
using normal procedures with the import wizard. 

3. Once the data is loaded in AB, just have AB substract 1000000. 
For example:

DataArray1 = Open - 1000000;// this turn 876544 back into 123456.
// DataArray1 can then be used in your formulas.
// This approach is more work now, but if the 4.0 upgrade accepts 
negative numbers for importing, then you would not need to rewrite 
your formulas.

Hope this helps. 

b

--- In amibroker@xxxx, CARRASSET Stephane <nenapacwanfr@xxxx> wrote:
> Hi,
> 
> if I want import data with a negative value ( for some breath 
indicator)
> like this one below.
> where the third column is the "close" and the fourth is OI
> the wizard ascci import returns always an error,
> 
> have you a solution?
> 
> 
> 
> <<...OLE_Obj...>> 
> 
> stephane carrasset