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" <notanaiqgen...@...> 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 10000 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 10000. > > > > PositionScore = rank; // 77.904854 is one value observed > > PositionScaore = PositionScore + 10000; // 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. > > >