[amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-20 Thread sfclimbers
If you want your position scores to all be positive, you can square the values.

Mike

--- In amibroker@yahoogroups.com, "bistrader"  wrote:
>
> Herman and TJ and others.  Thanks.  Was not thinking of the 7 digit / 32 bit. 
>  Caught me off guard.  I am wondering if one needs to in any way take this 
> into account when selecting a value to add to positionscore when one wants 
> all values to be positive??
>




Re: [amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-20 Thread Tomasz Janeczko
  Hello,

Simply common sense is good. If your score values are in the range of hundreds, 
add one thousand to make them all positive.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-07-20 17:35, bistrader wrote:
> Herman and TJ and others.  Thanks.  Was not thinking of the 7 digit / 32 bit. 
>  Caught me off guard.  I am wondering if one needs to in any way take this 
> into account when selecting a value to add to positionscore when one wants 
> all values to be positive??
>
>
>
>
> 
>
>  IMPORTANT PLEASE READ 
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't be considered)
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> Yahoo! Groups Links
>
>
>
>


[amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-20 Thread bistrader
Herman and TJ and others.  Thanks.  Was not thinking of the 7 digit / 32 bit.  
Caught me off guard.  I am wondering if one needs to in any way take this into 
account when selecting a value to add to positionscore when one wants all 
values to be positive??




Re: [amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-20 Thread Tomasz Janeczko
  Hello,

1. It is your call. 64-bit version is able to use more than 4GB of memory and 
is slightly faster. But only supports IB and IQFeed real time plugins.

2. Yes, both versions (32-bit and 64-bit) use same data files and you can use 
same database.

Best regards,
Tomasz Janeczko
amibroker.com

On 2010-07-20 13:33, sanjiv wrote:
> Hello Mr. Janeczko,
>
> Though now all my machines are Win7_64, I am continuing with Ami_Pro_32. Does 
> the benefit you described below warrant that I should migrate toward 
> Ami_Pro_64 ?
>
> Further, will the AmiBroker Native database being updated via ASCII import be 
> compatible across Ami_32 and Ami_64 interchangably.
>
> With regards
>
> Sanjiv Bansal
>
>
>
> --- In amibroker@yahoogroups.com, Tomasz Janeczko  wrote:
>>Hello,
>>
>> There is* no problem* with adding 1000 to positionscore.
>>
>> You are adding the same value to *all* positionscore numbers and by doing so
>> you will NOT change the ordering (ranking) even if 8th significant digit is 
>> subject to standard IEEE 32-bit rounding,
>> because larger number will still be larger after adding constant, no matter 
>> if result is rounded in 8th significant place or not.
>> So it is irrelevant.
>>
>> Also, it is important to understand that AmiBroker AFL arrays use standard 
>> 32-bit floating point, recommended reading:
>> http://en.wikipedia.org/wiki/IEEE754
>>
>> The same is used by majority of T/A applications since there is really no 
>> point in wasting memory on more.
>> Using 32-bit floating point has two main advantages:
>> a) consumes HALF of memory required for doubles (this *is* important, more 
>> important that you think, because
>> if you have for example 50 bars, in floats it is 2MB and it fits into 
>> CPU cache, while in doubles it would be 4MB and
>> may not fit into CPU cache).
>> b) 32-bit floating point numbers can be computed much faster. It simply 
>> takes less processor cycles to compute 32-bit float than
>> 64-bit float. 64-bit version of AmiBroker is going even further and is using 
>> SSE2 instructions. This means that vectors of 4 single-precision
>> numbers are processed in parallel using single SSE2 instruction on SINGLE 
>> processor.
>> This gives more speed on single core than achievable using multiple cores.
>>
>> Note also AmiBroker *does use double precision (64bit)* where it is 
>> necessary (for certain internal calculations)
>>
>>
>> Best regards,
>> Tomasz Janeczko
>> amibroker.com
>>
>> On 2010-07-20 01:37, Paul D wrote:
>>>
>>> Oh whoops. Sorry - apparently I didn't read your question carefully enough. 
>>> Not sure how to solve the precision problem.
>>>
>>> Paul
>>>
>>> 
>>> *From:* Herman
>>> *To:* bistrader
>>> *Sent:* Mon, July 19, 2010 3:19:01 PM
>>> *Subject:* Re: [amibroker] Why does adding 1 to PositionScore cause 
>>> problems?
>>>
>>> You are exceeding the 7-digit precision (32 bits?) of AmiBroker.
>>>
>>> herman
>>>
>>> *>  I have an afl with PositionScore at 77.904854 for one
 ticker.  PositionScore also has negative values for
 certain tickers for certain dates.  So, I add 1 to
 PositionScore as I want all PositionScore values to be
 positive.  I do so as followings and notice that 77.904854
 changes to 10077.90527.  Happens to many tickers.  Not
 what I expected.  I expected values to increase by exactly 1.
 PositionScore = rank; // 77.904854 is one value observed
 PositionScaore = PositionScore + 1; // expect to get
 10077.904854 but get 10077.90527
 I know I am missing something with precision.  I looked
 in help but could not find anything to help.  Does anyone
 know what is going on and where in documentation?
 Thanks.
>>>
>>>
  - - --
  IMPORTANT PLEASE READ 
 This group is for the discussion between users only.
 This is *NOT* technical support channel.
 TO GET TECHNICAL SUPPORT send an e-mail directly to
 SUPPORT {at} amibroker.com
 TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
 http://www.amibroke r.com/feedback/
 (submissions sent via other channels won't be considered)
 For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
 http://www.amibroke r.com/devlog/
 Yahoo! Groups Links
>>>
>>>
>>> *
>>>
>>> * *
>>> * *
>>>
>>>
>>>
>>>
>
>
>
> 
>
>  IMPORTANT PLEASE READ 
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> TO GET TECHNICAL SUPPORT send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> http://www.amibroker.com/feedback/
> (submissions sent via other channels won't

[amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-20 Thread sanjiv
Hello Mr. Janeczko,

Though now all my machines are Win7_64, I am continuing with Ami_Pro_32. Does 
the benefit you described below warrant that I should migrate toward Ami_Pro_64 
?

Further, will the AmiBroker Native database being updated via ASCII import be 
compatible across Ami_32 and Ami_64 interchangably.

With regards

Sanjiv Bansal



--- In amibroker@yahoogroups.com, Tomasz Janeczko  wrote:
>
>   Hello,
> 
> There is* no problem* with adding 1000 to positionscore.
> 
> You are adding the same value to *all* positionscore numbers and by doing so
> you will NOT change the ordering (ranking) even if 8th significant digit is 
> subject to standard IEEE 32-bit rounding,
> because larger number will still be larger after adding constant, no matter 
> if result is rounded in 8th significant place or not.
> So it is irrelevant.
> 
> Also, it is important to understand that AmiBroker AFL arrays use standard 
> 32-bit floating point, recommended reading:
> http://en.wikipedia.org/wiki/IEEE754
> 
> The same is used by majority of T/A applications since there is really no 
> point in wasting memory on more.
> Using 32-bit floating point has two main advantages:
> a) consumes HALF of memory required for doubles (this *is* important, more 
> important that you think, because
> if you have for example 50 bars, in floats it is 2MB and it fits into CPU 
> cache, while in doubles it would be 4MB and
> may not fit into CPU cache).
> b) 32-bit floating point numbers can be computed much faster. It simply takes 
> less processor cycles to compute 32-bit float than
> 64-bit float. 64-bit version of AmiBroker is going even further and is using 
> SSE2 instructions. This means that vectors of 4 single-precision
> numbers are processed in parallel using single SSE2 instruction on SINGLE 
> processor.
> This gives more speed on single core than achievable using multiple cores.
> 
> Note also AmiBroker *does use double precision (64bit)* where it is necessary 
> (for certain internal calculations)
> 
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> 
> On 2010-07-20 01:37, Paul D wrote:
> >
> >
> > Oh whoops. Sorry - apparently I didn't read your question carefully enough. 
> > Not sure how to solve the precision problem.
> >
> > Paul
> >
> > 
> > *From:* Herman 
> > *To:* bistrader 
> > *Sent:* Mon, July 19, 2010 3:19:01 PM
> > *Subject:* Re: [amibroker] Why does adding 1 to PositionScore cause 
> > problems?
> >
> > You are exceeding the 7-digit precision (32 bits?) of AmiBroker.
> >
> > herman
> >
> > *> I have an afl with PositionScore at 77.904854 for one
> > > ticker.  PositionScore also has negative values for
> > > certain tickers for certain dates.  So, I add 1 to
> > > PositionScore as I want all PositionScore values to be
> > > positive.  I do so as followings and notice that 77.904854
> > > changes to 10077.90527.  Happens to many tickers.  Not
> > > what I expected.  I expected values to increase by exactly 1.
> >
> > > PositionScore = rank; // 77.904854 is one value observed
> > > PositionScaore = PositionScore + 1; // expect to get
> > > 10077.904854 but get 10077.90527
> >
> > > I know I am missing something with precision.  I looked
> > > in help but could not find anything to help.  Does anyone
> > > know what is going on and where in documentation?
> >
> > > Thanks.
> >
> >
> >
> > >  - - --
> >
> > >  IMPORTANT PLEASE READ 
> > > This group is for the discussion between users only.
> > > This is *NOT* technical support channel.
> >
> > > TO GET TECHNICAL SUPPORT send an e-mail directly to
> > > SUPPORT {at} amibroker.com 
> >
> > > TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
> > > http://www.amibroke r.com/feedback/ 
> > > (submissions sent via other channels won't be considered)
> >
> > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> > > http://www.amibroke r.com/devlog/ 
> >
> > > Yahoo! Groups Links
> >
> >
> >
> > *
> >
> > * *
> > * *
> >
> >
> >
> >
>




[amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-19 Thread notanaiqgenius
Also, I might add that it is usually a good idea to add a large fixed
positive number like you are doing, especially if you have a ranking
variable that goes negative and you don't want those very negative
numbers to end up being turned into the top rank when the PositionScore
variable applies its internal absolute value function to it.

You can also check out the setting:

SetOption( "SeparateLongShortRank", false );

which if true will make 2 separate lists, 1 for longs and 1 for shorts
and then once ranked separately, interweave the two lists starting with
1st long then 1st short then 2nd long then 2nd short until you are
either out of longs or shorts or both (or can't take any more signals in
portfolio).

Paul


--- In amibroker@yahoogroups.com, "notanaiqgenius" 
wrote:
>
> PositionScore is always the ABSOLUTE VALUE of whatever you put in it.
>
> From the user guide's Portfolio-level back testing article:
>
> "USING POSITION SCORE
>
> You can use new PositionScore variable to decide which trades should
be
> entered if there are more entry signals on different securities than
> maximum allowable number of open positions or available funds. In such
> case AmiBroker will use the absolute value of PositionScore variable
to
> decide which trades are preferred."
>
> Hope that helps.
>
> Paul
>
> --- In amibroker@yahoogroups.com, "bistrader" bistrader@ wrote:
> >
> > I have an afl with PositionScore at 77.904854 for one ticker.
> PositionScore also has negative values for certain tickers for certain
> dates.  So, I add 1 to PositionScore as I want all PositionScore
> values to be positive.  I do so as followings and notice that
77.904854
> changes to 10077.90527.  Happens to many tickers.  Not what I
expected.
> I expected values to increase by exactly 1.
> >
> > PositionScore = rank; // 77.904854 is one value observed
> > PositionScaore = PositionScore + 1; // expect to get
10077.904854
> but get 10077.90527
> >
> > I know I am missing something with precision.  I looked in help but
> could not find anything to help.  Does anyone know what is going on
and
> where in documentation?
> >
> > Thanks.
> >
>




[amibroker] Re: Why does adding 10000 to PositionScore cause problems?

2010-07-19 Thread notanaiqgenius
PositionScore is always the ABSOLUTE VALUE of whatever you put in it.

>From the user guide's Portfolio-level back testing article:

"USING POSITION SCORE

You can use new PositionScore variable to decide which trades should be
entered if there are more entry signals on different securities than
maximum allowable number of open positions or available funds. In such
case AmiBroker will use the absolute value of PositionScore variable to
decide which trades are preferred."

Hope that helps.

Paul

--- In amibroker@yahoogroups.com, "bistrader"  wrote:
>
> I have an afl with PositionScore at 77.904854 for one ticker. 
PositionScore also has negative values for certain tickers for certain
dates.  So, I add 1 to PositionScore as I want all PositionScore
values to be positive.  I do so as followings and notice that 77.904854
changes to 10077.90527.  Happens to many tickers.  Not what I expected. 
I expected values to increase by exactly 1.
>
> PositionScore = rank; // 77.904854 is one value observed
> PositionScaore = PositionScore + 1; // expect to get 10077.904854
but get 10077.90527
>
> I know I am missing something with precision.  I looked in help but
could not find anything to help.  Does anyone know what is going on and
where in documentation?
>
> Thanks.
>